java连接sqlserver报错的解决方法(com.microsoft.sqlserver.jdbc.SQLServerException:The TCPIP……)

xiaoxiao2021-02-28  31

今天整合Spring MVC整合Mybatis的时候报错如下:

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

解决方法:

1.打开SQL Server配置管理器,在左侧双击SQL Server网络配置

2.在SQL Server的协议中,这时会看到右侧TCP/IP的状态被禁用了!右击开启。

3.最后,重新启动一下SQL Server服务。

转载请注明原文地址: https://www.6miu.com/read-2631497.html

最新回复(0)