Home Database Mysql Tutorial 常见SQL Server连接错误及解决方法

常见SQL Server连接错误及解决方法

Jun 07, 2016 pm 05:53 PM
server sql Solution connection error

一、SQL Server不存在或访问被拒绝 分析:此问题最为复杂,由于错误发生的原因比较多,所以需要检查很多方面。 一般情况下,有几种可能性: 1.SQL Server名称或IP地址拼写有误。 2.服务器端网络配置有误。 3.客户端网络配置有误。 要解决此问题,我们一般要

    一、SQL Server不存在或访问被拒绝

  分析:此问题最为复杂,由于错误发生的原因比较多,所以需要检查很多方面。

  一般情况下,有几种可能性:

  1.SQL Server名称或IP地址拼写有误。

  2.端网络配置有误。

  3.客户端网络配置有误。  

  要解决此问题,我们一般要遵循以下的步骤来一步步找出导致错误的原因。

  首先,检查网络物理连接

  ping

  假如ping不成功,说明物理连接有问题,这时候要检查硬件设备,如网卡,HUB,路由器等.。

  另外还有一种可能是由于客户端和服务器之间安装有防火墙软件造成的,比如ISA Server。

  防火墙软件可能会屏蔽对ping,telnet等的响应,因此在检查连接问题的时候,我们要先把防火墙软件暂时关闭,或者打开所有被封闭的端口。

  如果ping成功而,ping失败则说明名字解析有问题,这时候要检查DNS服务是否正常。

  有时候客户端和服务器不在同一个局域网里面,这时候很可能无法直接使用服务器名称来标识该服务器,这时候我们可以使用HOSTS文件来进行名字解析, 具体的方法是:

  1.使用记事本打开HOSTS文件(一般情况下位于C:\WINNT\system32\drivers\etc)。

  添加一条IP地址与服务器名称的对应记录,如:

  172.168.10.24 myserver

  2.或在SQL Server的客户端网络实用工具里面进行配置,后面会有详细说明。


  其次,使用telnet命令检查SQL Server服务器工作状态

  telnet 1433

  如果命令执行成功,可以看到屏幕一闪之后光标在左上角不停闪动,这说明SQL Server服务器工作正常,并且正在监听1433端口的 TCP/IP 连接。

  如果命令返回"无法打开连接"的错误信息,则说明服务器端没有启动SQL Server服务, 也可能服务器端没启用 TCP/IP 协议,或者服务器端没有在SQL Server默认的端口1433上监听。

  接着,我们要到服务器上检查服务器端的网络配置, 检查是否启用了命名管道.是否启用了TCP/IP协议等等

  可以利用 SQL Server 自带的服务器网络使用工具来进行检查。

  点击:程序—Microsoft SQL Server—服务器网络使用工具。

  打开该工具后,在“常规”中可以看到服务器启用了哪些协议。

  一般而言,我们启用命名管道以及 TCP/IP 协议.

  点中 TCP/IP 协议,选择"属性",我们可以来检查 SQK Server 服务默认端口的设置.一般而言,我们使用 SQL Server默认的1433端口.如果选中"隐藏服务器",则意味着客户端无法通过枚举服务器来看到这台服务器,起到了保护的作用,但不影响连接。

  接下来我们要到客户端检查客户端的网络配置

  我们同样可以利用 SQL Server 自带的客户端网络使用工具来进行检查, 所不同的是这次是在客户端来运行这个工具.

  点击:程序—Microsoft SQL Server—客户端网络使用工具。

  打开该工具后,在"常规"项中,可以看到客户端启用了哪些协议。

  一般而言,我们同样需要启用命名管道以及TCP/IP 协议。

  点击TCP/IP协议,选择"属性",可以检查客户端默认连接端口的设置,该端口必须与服务器一致。

  单击"别名"选项卡,还可以为服务器配置别名.服务器的别名是用来连接的名称,连接参数中的服务器是真正的服务器名称,两者可以相同或不同.别名的设置与使用HOSTS文件有相似之处。

  通过以上几个方面的检查,基本上可以排除第一种错误。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1658
14
PHP Tutorial
1257
29
C# Tutorial
1231
24
Is the company's security software causing the application to fail to run? How to troubleshoot and solve it? Is the company's security software causing the application to fail to run? How to troubleshoot and solve it? Apr 19, 2025 pm 04:51 PM

Troubleshooting and solutions to the company's security software that causes some applications to not function properly. Many companies will deploy security software in order to ensure internal network security. ...

Centos minio installation permissions issues Centos minio installation permissions issues Apr 14, 2025 pm 02:00 PM

Permissions issues and solutions for MinIO installation under CentOS system When deploying MinIO in CentOS environment, permission issues are common problems. This article will introduce several common permission problems and their solutions to help you complete the installation and configuration of MinIO smoothly. Modify the default account and password: You can modify the default username and password by setting the environment variables MINIO_ROOT_USER and MINIO_ROOT_PASSWORD. After modification, restarting the MinIO service will take effect. Configure bucket access permissions: Setting the bucket to public will cause the directory to be traversed, which poses a security risk. It is recommended to customize the bucket access policy. You can use MinIO

Can vs code run in Windows 8 Can vs code run in Windows 8 Apr 15, 2025 pm 07:24 PM

VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

What are the common misunderstandings in CentOS HDFS configuration? What are the common misunderstandings in CentOS HDFS configuration? Apr 14, 2025 pm 07:12 PM

Common problems and solutions for Hadoop Distributed File System (HDFS) configuration under CentOS When building a HadoopHDFS cluster on CentOS, some common misconfigurations may lead to performance degradation, data loss and even the cluster cannot start. This article summarizes these common problems and their solutions to help you avoid these pitfalls and ensure the stability and efficient operation of your HDFS cluster. Rack-aware configuration error: Problem: Rack-aware information is not configured correctly, resulting in uneven distribution of data block replicas and increasing network load. Solution: Double check the rack-aware configuration in the hdfs-site.xml file and use hdfsdfsadmin-printTopo

Can visual studio code be used in python Can visual studio code be used in python Apr 15, 2025 pm 08:18 PM

VS Code can be used to write Python and provides many features that make it an ideal tool for developing Python applications. It allows users to: install Python extensions to get functions such as code completion, syntax highlighting, and debugging. Use the debugger to track code step by step, find and fix errors. Integrate Git for version control. Use code formatting tools to maintain code consistency. Use the Linting tool to spot potential problems ahead of time.

The Purpose of SQL: Interacting with MySQL Databases The Purpose of SQL: Interacting with MySQL Databases Apr 18, 2025 am 12:12 AM

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

Can vscode compare two files Can vscode compare two files Apr 15, 2025 pm 08:15 PM

Yes, VS Code supports file comparison, providing multiple methods, including using context menus, shortcut keys, and support for advanced operations such as comparing different branches or remote files.

See all articles