Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

change (local) to localhost and what's the difference

1 view
Skip to first unread message

who

unread,
Apr 17, 2004, 8:54:20 PM4/17/04
to
Two questions

Once sql server has been installed how to change from (local) to
localhost or the other way arround from (local) to localhost? (currently
set (local) and want to change to localhost.

Secondly, what the hell is the difference between them. On development
machines I have installed sometimes localhost will not work but (local)
will. This is the case even when the hosts (<win>/system32/drivers/etc)
file has an entry like the following

127.0.0.1 localhost


Seems very confusing to have two different ways to refer the 'local
machine'

???

Tibor Karaszi

unread,
Apr 18, 2004, 1:04:12 PM4/18/04
to
(local) is resolved by the SQL Server netlib and uses whatever network protocol you have configured in Client
Network Utility. The netlib does not understand localhost, so it passes this to the IP stack which resolves
it. In the cases where localhost doesn't work, you probably didn't configure the client to use the TCP/IP
Netlib.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp


"who" <wh...@spambucket.com> wrote in message news:4081D1C1...@spambucket.com...

who

unread,
Apr 18, 2004, 3:22:56 PM4/18/04
to
Thanks Tibor for the reply. I thought about that and checked with the network utility and it reported that I had
'named pipes' and TCP/IP. The properties under TCP/IP said that I was using port 1433. Still the connection to
localhost did not work. Is there another step that I'm missing somewhere??

Here's some more things I did but don't really understand the outcome except that isql and osql get at the
database differently,

ping localhost WORKS FINE

connectionString = "server=localhost;uid=sa;pwd=;database=pubs;"
FAILS
connectionString= "server=(local);uid=sa;pwd=;database=pubs;"
WORKS

C:\>osql -U sa -S localhost FAILS
Password:
[DBNETLIB]General network error. Check your network documentation.
[DBNETLIB]ConnectionRead (recv()).

C:\>isql -U sa -S localhost WORKS
Password:
1>

Tibor Karaszi

unread,
Apr 18, 2004, 4:29:15 PM4/18/04
to
Did you check on the client or server machine? Also, did you use Client or Server network utility? And, which
of the netlibs were at the top if you checked on the client machine using client network utility?

I really can't say why ISQL work using the word localhost. My guess is that there is code inside ISQL that
changes "localhost" to "(local)" so that when this arrives to the netlib, it receives "(local)". But as I
don't have the source code available for ISQL, I can't confirm that guess.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp


"who" <wh...@spambucket.com> wrote in message news:4082D596...@spambucket.com...

who

unread,
Apr 18, 2004, 5:58:47 PM4/18/04
to

Tibor Karaszi wrote:

> Did you check on the client or server machine?

They are one and the same. This is my development machine. I doing ASP.NET
development. The Sql Server is local.


> Also, did you use Client or Server network utility?

Server

> And, which
> of the netlibs were at the top if you checked on the client machine using client network utility?

named pipes was at the top then TCP/IP

Tibor Karaszi

unread,
Apr 19, 2004, 3:12:11 AM4/19/04
to
As it is the client that connects and determine which netlib to use, you need to check using *Client* Network
Utility.

--

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp

"who" <wh...@spambucket.com> wrote in message news:4082FA1D...@spambucket.com...

0 new messages