Is there a way to connect LOCALHOST without using ComputerName in SQL Server?

Is it possible to connect LOCALHOST DatabaseEgninewithout providing a computer name, for example MyComputerName\LOCALHOST

?

(I am using SQL Server 2012 - Standard Edition)

+3


source to share


3 answers


you can use .

as server name eg.



    .\mssqlserver 
    .\sqlexpress

      

+1


source


For the default instance:

(local) or. (that's the point)



Named instance: (local) \ InstanceName (or). \ InstanceName

+1


source


MyComputerName\LOCALHOST

the named instance is namedLOCALHOST

on your computer. To connect to it, you must either provide an instance name (and use the SQL Server Browser service ), or explicitly specify a listening port (and the instance is configured to listen on a static port , not the default, since these are dynamic ports by default). So any of the below will work:

  • .\LOCALHOST

  • localhost\LOCALHOST

  • local\LOCALHOST

  • 127.0.0.1\LOCALHOST

  • machinename\LOCALHOST

  • .:<port>

  • localhost:<port>

  • 127.0.0.1:<port>

  • etc.

It is highly unlikely that you really wanted to set up a named instance of LOCALHOST. You probably didn't read the configuration dialogs and misconfigured the instance name. My recommendation would be to install it again, choosing the default instance (i.e. No Name) or a more convenient and less confusing instance name.

+1


source







All Articles