SQL Server 2005 使用得有阵子了,写些笔记,好记性不如烂笔头.
安装就不用说了,Google自然是可以找到相当全面的安装教程的. 只说些远程连接的问题,因为自己也实在是被这些诡异的问题困扰了很久的.
问题描述:
服务器机器配置: Windows XP SP2 + SQL Server 2005开发版 SP1
客户端用SQL Server Management Studio连接服务器的SQL Server 2005 时,提示连接不上.
错误信息: An error has occurred while establishing a connection to the server. When connecting to SQL Server allow remote connections.(provider: SQL Network Interfaces, error:26-Error Locating Server/Instance Sepcified)(Microsoft SQL Server)
解决办法:
1. 确保服务器端的数据库中存在sa,并支持混合登录模式.默认安装的时候,可能会忽略建立sa.
2. 确保服务器端的数据库是支持远程调用的.打开SQL Server Management Studio,选择该数据库,右键菜单"Properties",在打开的对话框中选择Connections,把Allow remote connections to this server选上.
3. 确保服务器端的SQL服务的TCP/IP是Enable的.打开SQL Server Configuration Manager. 选择SQL Server 2005 Network Configuration下的Protocols for SQL2005( 我安装的SQL示例名为SQL2005), 把Named Pipes和TCP/IP都修改为Enabled,默认是Disabled.
4. 确保服务器端的SQL实例的远程调用是支持TIP/IP和named pipes的. 打开SQL Server Surface Area Configuration Manager,在打开的页面中选择Surface Area Configuration for Services and Connections.选中实例的Remote Connections,把Using both TCP/IP and named pipes选中.
5. 重启服务器端的SQL Server 2005服务,确保SQL Server Agent和SQL Server Browser的服务也启动了. 默认都是需要手动启动,可以改成Automatic.