Home > Database > SQL > body text

What to do if sql fails to connect to the server

藏色散人
Release: 2020-02-18 10:56:52
Original
17108 people have browsed it

What to do if sql fails to connect to the server

What should I do if SQL fails to connect to the server?

Due to the following reasons:

1. The database engine has not started.

There are two starting methods:

(1)Start- >Programs->Microsoft SQL Server 2008->SQL Server 2008 Surface Application Configurator, click "Service Connection Surface Application Configurator" in the interface that opens, find Database Engine in the interface that opens, and click " "Service", check on the right to see if it has been started. If not, click "Start" and make sure the "Startup Type" is automatic, not manual, otherwise it will have to be started manually the next time you turn on the computer;

(2) Can be opened: Start->Programs->Microsoft SQL Server 2008->Configuration Tools->SQL Server Configuration Manager, select SQL Server (MSSQLSERVER) in the SQL Server 2008 service, and click in the toolbar The "Start Service" button changes the service status to Start;

When using the above two methods, sometimes an error may occur during startup[/b] and cannot be started. In this case, check "SQL SQL Server 2008 Network Configuration in Server 2008 Configuration Manager -> Is VIA in the MSSQLSERVER protocol enabled? If so, disable it. Then perform one of the above operations.

Recommendation: "sql tutorial"

2. When making a remote connection, whether the remote connection has been allowed.

SQL Server 2008 by default Local connection only. We can manually enable remote connection. In the first method above, find the Database Engine, click "Remote Connection", and change "Local connection only (L)" to "Local connection and Remote Connection (R)", and select "Use TCP/IP and named pipes (B) at the same time".

3. If it is a remote connection, check whether the statement to connect to the database is correct and whether the login account is correct. Correct, is the password correct, etc.

When I connected to the database in a local area network, there was a problem with the connection string. When one machine in the local area network connected to another machine in the database, the Data Source =The IP of another machine with the database installed. I always get the above error when connecting to the database. After checking for a long time, I later found that the IP was not correctly passed to the connection string. It turned out that when I connected, I used It is local, that is, 127.0.0.1, and the entered IP is not passed to the connection string.

For more programming related content, please pay attention to the Programming Introduction column on the php Chinese website!

The above is the detailed content of What to do if sql fails to connect to the server. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
sql
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!