找回密码
 注册
首页 ≡≡网络技术≡≡ 数据库 SQL Server 不存在或拒绝访问解决方法! ...

SQL Server 不存在或拒绝访问解决方法!

灰儿 2007-2-14 17:39:45
<P align=center>SQL Server 不存在或拒绝访问解决方法!</P><P>&nbsp; 这个是最复杂的,错误发生的原因比较多,需要检查的方面也比较多. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 一般说来,有以下几种可能性: &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 1,SQL &nbsp; Server名称或IP地址拼写有误 &nbsp; <BR>&nbsp; 2,服务器端网络配置有误 &nbsp; <BR>&nbsp; 3,客户端网络配置有误 &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 要解决这个问题,我们一般要遵循以下的步骤来一步步找出导致错误的原因. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; ============= &nbsp; 首先,检查网络物理连接 &nbsp; ============= &nbsp; <BR>&nbsp; ping &nbsp; &lt;服务器IP地址/服务器名称&gt; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 如果 &nbsp; ping &nbsp; &lt;服务器IP地址&gt; &nbsp; 不成功,说明物理连接有问题,这时候要检查硬件设备,如网卡,HUB,路由器等. &nbsp; <BR>&nbsp; 还有一种可能是由于客户端和服务器之间安装有防火墙软件造成的,比如 &nbsp; ISA &nbsp; Server.防火墙软件可能会屏蔽对 &nbsp; ping,telnet &nbsp; 等的响应 &nbsp; <BR>&nbsp; 因此在检查连接问题的时候,我们要先把防火墙软件暂时关闭,或者打开所有被封闭的端口. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 如果ping &nbsp; &lt;服务器IP地址&gt; &nbsp; 成功而,ping &nbsp; &lt;服务器名称&gt; &nbsp; 失败 &nbsp; <BR>&nbsp; 则说明名字解析有问题,这时候要检查 &nbsp; DNS &nbsp; 服务是否正常. &nbsp; <BR>&nbsp; 有时候客户端和服务器不在同一个局域网里面,这时候很可能无法直接使用服务器名称来标识该服务器,这时候我们可以使用HOSTS文件来进行名字解析, &nbsp; <BR>&nbsp; 具体的方法是: &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 1.使用记事本打开HOSTS文件(一般情况下位于C:&#92;WINNT&#92;system32&#92;drivers&#92;etc). &nbsp; <BR>&nbsp; 添加一条IP地址与服务器名称的对应记录,如: &nbsp; <BR>&nbsp; 172.168.10.24 &nbsp; myserver &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 2.或在 &nbsp; SQL &nbsp; Server &nbsp; 的客户端网络实用工具里面进行配置,后面会有详细说明. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; ============= &nbsp; 其次,使用 &nbsp; telnet &nbsp; 命令检查SQL &nbsp; Server服务器工作状态 &nbsp; ============= &nbsp; <BR>&nbsp; telnet &nbsp; &lt;服务器IP地址&gt; &nbsp; 1433 &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 如果命令执行成功,可以看到屏幕一闪之后光标在左上角不停闪动,这说明 &nbsp; SQL &nbsp; Server &nbsp; 服务器工作正常,并且正在监听1433端口的 &nbsp; TCP/IP &nbsp; 连接 &nbsp; <BR>&nbsp; 如果命令返回"无法打开连接"的错误信息,则说明服务器端没有启动 &nbsp; SQL &nbsp; Server &nbsp; 服务, &nbsp; <BR>&nbsp; 也可能服务器端没启用 &nbsp; TCP/IP &nbsp; 协议,或者服务器端没有在 &nbsp; SQL &nbsp; Server &nbsp; 默认的端口1433上监听. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; =============接着,我们要到服务器上检查服务器端的网络配置,检查是否启用了命名管道.是否启用了 &nbsp; TCP/IP &nbsp; 协议等等 &nbsp; ============= &nbsp; <BR>&nbsp; 可以利用 &nbsp; SQL &nbsp; Server &nbsp; 自带的服务器网络使用工具来进行检查. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 点击:程序 &nbsp; -- &nbsp; Microsoft &nbsp; SQL &nbsp; Server &nbsp; -- &nbsp; 服务器网络使用工具 &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 打开该工具后,在"常规"中可以看到服务器启用了哪些协议. &nbsp; <BR>&nbsp; 一般而言,我们启用命名管道以及 &nbsp; TCP/IP &nbsp; 协议. &nbsp; <BR>&nbsp; 点中 &nbsp; TCP/IP &nbsp; 协议,选择"属性",我们可以来检查 &nbsp; SQK &nbsp; Server &nbsp; 服务默认端口的设置 &nbsp; <BR>&nbsp; 一般而言,我们使用 &nbsp; SQL &nbsp; Server &nbsp; 默认的1433端口.如果选中"隐藏服务器",则意味着客户端无法通过枚举服务器来看到这台服务器,起到了保护的作用,但不影响连接. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; ============= &nbsp; 接下来我们要到客户端检查客户端的网络配置 &nbsp; ============= &nbsp; <BR>&nbsp; 我们同样可以利用 &nbsp; SQL &nbsp; Server &nbsp; 自带的客户端网络使用工具来进行检查, &nbsp; <BR>&nbsp; 所不同的是这次是在客户端来运行这个工具. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 点击:程序 &nbsp; -- &nbsp; Microsoft &nbsp; SQL &nbsp; Server &nbsp; -- &nbsp; 客户端网络使用工具 &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 打开该工具后,在"常规"项中,可以看到客户端启用了哪些协议. &nbsp; <BR>&nbsp; 一般而言,我们同样需要启用命名管道以及 &nbsp; TCP/IP &nbsp; 协议. &nbsp; <BR>&nbsp; 点击 &nbsp; TCP/IP &nbsp; 协议,选择"属性",可以检查客户端默认连接端口的设置,该端口必须与服务器一致. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 单击"别名"选项卡,还可以为服务器配置别名.服务器的别名是用来连接的名称, &nbsp; <BR>&nbsp; 连接参数中的服务器是真正的服务器名称,两者可以相同或不同.别名的设置与使用HOSTS文件有相似之处. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 通过以上几个方面的检查,基本上可以排除第一种错误.</P>
您需要登录后才可以回帖 登录 | 注册
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。