步骤如下:
- Run SQL Server Configuration Manager.
- Go to SQL Server Network Configuration > Protocols for SQLEXPRESS.
- Make sure TCP/IP is enabled.
- 重启SQL Server服务
So far, so good, and entirely expected. But then:
- Right-click on TCP/IP and select Properties.
- Verify that, under IP2, the IP Address is set to the computer's IP address on the local subnet.
- Scroll down to IPAll.
- Make sure that TCP Dynamic Ports is blank. (Mine was set to some 5-digit port number.)
- Make sure that TCP Port is set to 1433. (Mine was blank.)
- 检查一下防火墙中1433端口是否打开,如果是服务器在云,检查一下网络安全组中是否打开了1433端口。
参考链接
How do I configure SQL Server Express to allow remote tcp/ip connections on port 1433?