今天整合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服务。
本文解决了一个在整合SpringMVC和Mybatis过程中遇到的连接数据库失败的问题。错误提示为TCP/IP连接到主机localhost,端口1433失败。解决方案包括启用SQL Server的TCP/IP协议、正确设置连接属性并重启SQL Server服务。
1638

被折叠的 条评论
为什么被折叠?



