为了账号安全,请及时绑定邮箱和手机立即绑定

抓狂,这个错误怎么解决

抓狂,这个错误怎么解决

流浪llllll 2016-12-05 18:39:24
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failureLast packet sent to the server was 0 ms ago. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2104) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:729) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:283) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at JDBCUtlTool.getConnection(JDBCUtlTool.java:17) at JDBCUtlTool.main(JDBCUtlTool.java:55)Caused by: java.net.UnknownHostException: localhost_3306 at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source) at java.net.InetAddress.getAddressesFromNameService(Unknown Source) at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:246) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2027) ... 13 moreException in thread "main" java.lang.NullPointerException at JDBCUtlTool.main(JDBCUtlTool.java:57)
查看完整描述

2 回答

?
yanrun

TA贡献317条经验 获得超240个赞

不应该是localhost_3306吧,应该是localhost:3306

查看完整回答
反对 回复 2016-12-06
  • 2 回答
  • 0 关注
  • 2302 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信