Solution: 1. Check whether tcp/ip is enabled and pay attention to the port number; 2. Check the network problem; 3. Use the telnet command to check the port situation; 4. Check the server item and whether the username and password are correct. ; 5. Check whether the server allows remote connections; 6. Start two authentication modes.
The operating environment of this tutorial: windows7 system, sql server 2008 version, Dell G3 computer.
When you cannot connect to the database, check the following items:
1. Network conditions. Check if tcp/ip is enabled and note the port number.
Open the SQL SERVER Configuration Manager and check the network configuration
## 2. Ping the server address to check for network problems. 3. Use the telnet command to check the port status. If there is a problem with the network, check the firewall settings, or try turning it off first. 4. Check the server items. Is the username and password correct? 5. Whether the server allows remote connections, check the security after logging in with Windows authentication->Login name->Login username->right-click properties, click Status: 6. Right-click the server name->Properties->Security, start two authentication modes## The above solves the problem of being unable to connect to the database .
Related recommendations: "
mysql tutorialThe above is the detailed content of What should I do if the SQL database cannot be connected?. For more information, please follow other related articles on the PHP Chinese website!