Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - When configuring an application, what is the difference between "."and "."and the IP address when connecting to the sql database?
When configuring an application, what is the difference between "."and "."and the IP address when connecting to the sql database?
When connecting to SQL Server, the specified server can take many forms:

Return address (127.0.0. 1)

The loopback address (127.0.0. 1) is equivalent to localhost, because it is specified in the hosts file that localhost points to 127.0.0. 1 Use TCP/IP connection.

A computer IP is equivalent to a domain name (unless the domain name refers to a loopback address instead of a computer IP). Use TCP/IP connection.

Computer name, this kind of access is easy to be restricted, for example, sometimes it won't work across network segments, which is generally useless. Manage connections using naming.

(local) and. It should be equivalent, at least for now, no difference has been found. Connect using named pipes.

**local is a local alias defined by SQL Server.

**localhost is the default DNS name of the address 127.0.0. 1 in TCP/IP protocol, which is registered in the local host file.

TCP/IP connection is suitable for slow networks, and port 1433 needs to be opened to connect.