SqlServer2005 连接不上 终极解决方法

x项目运行后控制台报错如下:

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 14303 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port

其实就是你数据库连接的端口的问题

直接上解决办法: 打开 SqlServer 配置管理器---》找的SqlServer 2005网络配置---》双击tcp/ip--选择IP地址---》拉到底---》IPALL 中动态端口设置为1433  完美解决

SqlServer2005 连接不上 终极解决方法