java.sql.SQLException: Network error IOException: Connection refused

时间:2024-03-16 11:00:55

发生原因的问题是,数据库从服务器换到本地,项目启动就报错

java.sql.SQLException: Network error IOException: Connection refused

程序和功能》启用或关闭Windows功能

java.sql.SQLException: Network error IOException: Connection refused

Telnet客户端打个勾

java.sql.SQLException: Network error IOException: Connection refused

win+R》cmd 》输入  telnet 127.0.0.1 1433    

java.sql.SQLException: Network error IOException: Connection refused

请继续往下看    ↓

找到 SQL Server 配置管理器

java.sql.SQLException: Network error IOException: Connection refused

找到MSSQLSERVER 的协议,点开

后边找到 TCP/IP 右击属性,确认TCP端口是1433

右击启用

java.sql.SQLException: Network error IOException: Connection refused

 

win+R》cmd 》输入  tservices.msc   找到SQL SERVER的服务 ,重启一下。

java.sql.SQLException: Network error IOException: Connection refused

重启完了之后 

win+R》cmd 》输入 telnet 127.0.0.1 1433

java.sql.SQLException: Network error IOException: Connection refused

大功告成

java.sql.SQLException: Network error IOException: Connection refused

重启项目 控制台没报错

java.sql.SQLException: Network error IOException: Connection refused