当前位置: 代码迷 >> Eclipse >> 127.0.0.1, port 1433 has failed. Error: Connection refused:
  详细解决方案

127.0.0.1, port 1433 has failed. Error: Connection refused:

热度:666   发布时间:2016-04-23 18:59:58.0
java连sqlserver2005数据库的问题


有这样的错误,连不上数据库,不知道为啥,该怎么解决?
fail to load JDBC/ODBC driver
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 127.0.0.1, port 1433 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.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1195)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(SQLServerConnection.java:1054)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:758)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at OperateData.init(OperateData.java:25)
at OperateData.<init>(OperateData.java:38)
at test.main(test.java:21)


------解决方案--------------------
你的连的本地数据库吗?拒绝访问了
------解决方案--------------------
服务起了吗?
------解决方案--------------------
“ Connection refused”拒绝了。数据库服务开没?你连的是不是本机数据库?
------解决方案--------------------
这个问题可能是端口号的问题,你看看你设置的端口号是不是1433,还有连接数据库时写的端口号是不是1433,我以前也遇过这种错,就是端口号的问题。
希望对你有所帮助!
------解决方案--------------------
端口号 查看一下
------解决方案--------------------
端口、网络、防火墙,都看看吧
------解决方案--------------------
你先用你的用户登陆一下SQL Server Manager 看能不能登录成功。
应该是你的登录的用户有点问题。
代码迷推荐解决方案:Listener refused the connection with the following error:,http://www.daimami.com/search?q=345213
  相关解决方案