Cannot connect to localhost, but may be using the computer name in SQL Server 2008

I use SQL Server 2008 and Visual Studio in Server Explorer, I can connect to SQL Server using my computer name, but I cannot use 127.0.0.1 or localhost, should they not be the same

Also, when using the connection string in the web.config file for a website, I cannot connect using localhost, but only with the computer name! Is there some kind of setup that I am missing somewhere in the SQL Configuration Manager?

+42
sql-server
Aug 27 '09 at 9:33
source share
5 answers

If someone has been following this post and still not solved their problems (like me), here is what solved it for me:

Step 1 I went to the TCP / IP line in the SQL Server network configuration in the "Protocols for SQLEXPRESS" section (although you should select the active sql server) and clicked on the properties:

enter image description here

Step 2 Then I made sure that in the "IP Addresses" section the IP4 group is "Enabled" = "Yes" and that the TCP port there is set to 1433 (the default SQL server port), as here:

enter image description here

Step 3 Finally, as a precaution, I also changed all the other ports of the IP group to 1433 and enabled = "Yes" them from IP2 to IP5 (I saw this on another computer). I also changed the IPAll TCP port (last group) to 1433. But that's just me. I'm crazy. To go crazy. This is good for you. Finally, make sure that Enabled is set to Yes on the protocol tab.




and then Hurray! it worked. I greet all kind-hearted people who are in no hurry to solve the problems of other people.

+71
Dec 24 '12 at 11:19
source share

You probably need to install Sql Server for "remote" permissions:

  • Go to Start> All Programs> Microsoft Sql Server 2008> Settings Tools> Sql Server Configuration Manager
  • When the configuration manager boots up, expand the "SQL Server Network Configuration" tree node to the left
  • Select the Sql server instance you are trying to connect to in the tree
  • All three "shared memory", "Named Pipes" and "TCP / IP" should appear as "Enabled" in the list on the right. For those who do not, double-click in turn and change the value "Disabled" to "Enabled" in the window that appears.
  • Click "Sql Server Services" in the tree structure
  • Select "SQL Server (Instance Name)" (where the InstanceName will probably be SqlExpress or MsSqlServer), right-click and select "Reboot"

Once the restart is complete, try connecting again - it should work now.

+17
Aug 27 '09 at 9:38
source share

Use localhost \ sql_server_instance_name

For example, localhost \ sqlexpress

Use . instead of 127.0.0.1

. \ SQLEXPRESS

+8
Aug 27 '09 at 9:37
source share

You can also try:. .\sql_server_instance_name

 .\SQLExpress 
+4
Aug 27 '09 at 9:42
source share

I had the same problem and it seemed to have two problems.

Rob advice was introduced first, i.e. Use the configuration manager to enable SQL connections.

Secondly, it was necessary to connect to a specific instance, as some people advised. From the configuration manager, I realized that I have two instances: SQLEXPRESS and HOMEINSTALL. I could make a connection using, for example, localhost \ sqlexpress or. \ Homeintall.

0
May 23 '12 at 16:31
source share



All Articles