The database of the Remote Test server has always been connected. Today, I want to open my database and connect my colleagues in the company. The connection failed! After turning around a lot, we finally got it done. Next, we will release this calendar, hoping to help bloggers who need it. PS: My colleagues and I use sqlserver2008 as the database. For more information, see sql20002005.
The database of the Remote Test server has always been connected. Today, I want to open my database and connect my colleagues in the company. The connection failed! After turning around a lot, we finally got it done. Next, we will release this calendar, hoping to help bloggers who need it. PS: My colleagues and I use sqlserver2008 and sql2000/2005 databases for reference.
The database of the Remote Test server has always been connected. Today, I want to open my database and connect my colleagues in the company. The connection failed! After turning around a lot, we finally got it done.
Next, we will release this calendar, hoping to help bloggers who need it.
PS: My colleagues and I use sqlserver2008 and sql2000/2005 for reference.
Because I opened my machine to allow my colleagues to connect to the server, the local machine is called a server and the colleague machine is called a client.
1. telnet Server
First, I want to use the telnet command for connection testing.
Because the default sqlserver service occupies port 1433, enter the doscommand on the client.
Telnet 128. 0. *. * 1433 // (128. 0. *. * is the Server IP address)
There is no doubt that the connection fails.
How can this problem be solved?
1. Disable Firewall
First, check whether it is blocked by the firewall. Open the control panel on the server-> windows Firewall, and click Close.
Then, enter the doscommand telnet 128. 0. *. * 1433 on the client.
Okay, the connection still fails.
2. Open the sqlserver Configuration Manager and modify the configuration (on the server side)
It's not just a firewall problem. Let's see if the sqlserver configuration is wrong.
Start> All Programs> Microsoft SQL Server 2008> Configuration tool> SQL Server Configuration Manager
Double-click to open the SQL Server network configuration under the SQL Server Configuration Manager (local) fold menu, and click to view the SQLEXPRESS Protocol
It turns out that my pipeline protocol Name pipes and TCP/IP have been disabled!
Right-click to enable
The Client protocol under the SQL Native Client 10.0 configuration menu is also changed as above to enable these two protocols.
Enter the doscommand telnet 128. 0. *. * 1433 on the client, and the connection is successful.
Certificate --------------------------------------------------------------------------------------------------------------------------------------------------------
Of course, if your SQL Server service is not started, it cannot be connected.
In the same Configuration Manager, click the SQL Server service to view the running status of the service. If it is stopped, click the service and right-click it to start it.
When the service is started, an error is reported? Will your port 1433 be occupied?
In the dos window, enter the command netstat-ano | Find "1433"
If it is found successfully, it indicates that the port is occupied. The last one is the process ID that occupies the port.
PS: Of course, I am using the SQL Server service itself. Because I have enabled this service, check whether the process ID is 1496?
At this time, you can either kill the process or the port. I will not talk about the brute force process killing. Modify the Port:
For SQL Server network configuration, click the SQLEXPRESS protocol to see the TCP/IP protocol?
This time, right-click the TCP/IP protocol and click Properties to switch to the IP address column. Modify the TCP port of each IP address and the port you want to specify (this port cannot be occupied again)
PS: You can directly modify the port in IPAll. See (the number in the red area is the port you want to modify)
Restart the SQL Server service.
Certificate --------------------------------------------------------------------------------------------------------------------------------------------------
Now, telnet is successful. I will use the sa account to connect to the database.
Still failed! I failed to connect to my sa account on the server!
2. modify Database Configuration attributes (server side)
In this case, the sa account has a problem. Let me check it.
Start> All Programs> Microsoft SQL Server 2008> SQL Server Management Studio
If you do not have this management tool, install it.
Use localhost first, and select "windows Authentication" for authentication (this should be acceptable)
Right-click localhost, select properties, and click Security. Modify "SQL Server and windows Authentication" for Server authentication"
At the same time, click Connect on the selection page on the left, find "allow remote connection to this server", and select this option.
Now, I am connected.
PS: Since this blog post was written the next day, I cannot recall some other problems that occurred in the middle. If you have any other problems, leave a message below.
Let's see what solutions we will provide.