views:

366

answers:

3

I've used all three of these when making local programmatic connections to databases. Is there any real difference between them?

A: 

They are generally synonyms. However, it depends on the application you are configuring. As long as the app understands what you mean, it shouldn't result in a performance loss. At least, not one you have to root out prematurely, if you get my drift.

Will
+7  A: 

The final result is the same, but 'localhost' resolves at the TCP/IP level, and (local), depending on the application, could be just an alias for 'localhost', but in SQLServer, '(local)' and '.' mean that the connection will be made using the named pipes (shared memory) protocol within the same machine (doesn't need to go through the TCP/IP stack).

That's the theory. In practice, I don't think there is substantial difference in performance or features if you use either one of them.

Sergio Acosta
+1  A: 

As far as I know the dot "." and "local" are windows application terms, not a "standard" term, localhost resolves to 127.0.0.1 in the TCP/IP level so if you want to make sure you are "compatible" across platforms you should use either localhost or 127.0.0.1

Gustavo Rubio
"localhost" is not a magic or reserved word; its definition exists in /etc/hosts, or \WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS, or…
ΤΖΩΤΖΙΟΥ