当前位置: 技术问答>linux和unix
linux中部署了一个应用,此应用要连接到一个mysql服务器,端口为3306
来源: 互联网 发布时间:2015-07-24
本文导语: 异常: Fail to connect to the database server: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection timed out ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection timed out STACKTRACE: java.net...
异常:
Fail to connect to the database server: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection timed out ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection timed out STACKTRACE: java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:426) at java.net.Socket.connect(Socket.java:376) at java.net.Socket.(Socket.java:291) at java.net.Socket.(Socket.java:119) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:121) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:220) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1768) at com.mysql.jdbc.Connection.(Connection.java:440) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400) at java.sql.DriverManager.getConnection(DriverManager.java:512) at
Fail to connect to the database server: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection timed out ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection timed out STACKTRACE: java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:426) at java.net.Socket.connect(Socket.java:376) at java.net.Socket.(Socket.java:291) at java.net.Socket.(Socket.java:119) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:121) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:220) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1768) at com.mysql.jdbc.Connection.(Connection.java:440) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400) at java.sql.DriverManager.getConnection(DriverManager.java:512) at
|
是不是没有添加远程用户
|
我想应该是MYSQL没有添加相应的用户并授权吧。