Open the SQL Server Configuration Manager
Ensure that TCP/IP is enabled
2. View properties, some may be set to 1433
My machine hasn’t been set up. It’s like this:
Port number is 2104, you can also set a larger value of the port number, after setting up, restart SQL SERVER, other do not need to restart.
Configure the “Advanced Settings” of the firewall by adding C: Program Files Microsoft SQL Server MSSQL 10. SQLEXPRESS MSSQL Binn sqlservr. exe, New Rules, to the “Inbound Rules”.
Put UDP port 1434 “New Rules” into “Inbound Rules”.
Otherwise, the client will not be able to access the dynamic ports used by TCP because it can’t access 1434 ports. If you just do experiments, you simply turn off the firewall, which saves a lot of setup time.
In addition:（If the client runs in Windows Virtual PC (XP) and uses the shared network (NAT), it can not use TCP dynamic port for remote connection, even if the firewalls at both ends of the customer service are closed. The IP addresses and hosts that are automatically assigned in the virtual machine are not in one segment. When using this option, virtual machines are not listed as stand-alone computers on the network. It is recommended to use Network Adapter Name. In both cases, TCP port 1433 or whatever you set up can be successfully connected remotely. ）
Check whether the SQL Server and Windows authentication modes are turned on. At first, I only have Windows authentication mode, but I can’t log in. After changing to mixed mode, I log in with a new user name.
If the remote connection is too slow, you can change the timeout
Note that after these two steps, you should restart the SQL Server service!
If you want to log in with a username, you can also create a new user, security login name new login name
The correct settings should be as follows:
OK, remote login should be okay!