Failed to connect to SQL SERVER by IP address (failed to configure as string) Graphic Solution

Source: Internet
Author: User
Tags microsoft sql server 2005

Failed to connect to SQL SERVER by using IP address or configuring as connection string

Scenario 1: WhenWebconfigFile

<Add key = "ConnectionString" value = "server = 127.0.0.1; database = database name; uid = sa; pwd = 1"/> to connect to the database, I found that I could not log on normally during login and encountered a lot of errors;

Scenario 2:

Alternatively, when you connect to SQL SERVER, enter the following IP Address:

 

The system prompts that a connection fails or a connection error occurs.

 

Solution:

Step 1: Check TCP/IPWhether the protocol has been started:

In the "Start" menu, find "Configuration tools" in microsoft SQL server 2005, open SQL SERVER Configuration Manager, and click in. Select the SQLEXPRESS protocol, in "TCP/IP" on the right, double-click it and enable it if "disabled" is displayed:

 

 

Step 2: Select "MSSQLSERVER protocol" and enable "TCP/IP"

 

Step 3: select the subnode "Client protocol" in "SQL Native Client configuration" and check whether the "TCP/IP" Protocol on the right is enabled. If not, enable it:

 

 

Step 4: Double-click "TCP/IP protocol" to view the properties panel and check whether the listening port is port 1433.

 

Step 5: restart the computer ~~ Test logon ~~ Succeeded ~~~

 

 

Additional:

If "local" or "localhost" cannot be used

Solution:

Open the C: \ Windows \ System32 \ drivers \ etc path and find

Hosts file;

Open it in notepad to see if there are any examples:
Copy codeThe Code is as follows:
# Localhost name resolution is handled within DNS itself.
#127.0.0.1 localhost

If not, add them below;

Then restart the computer ~~ OK ~~

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.