mysql数据库连接错误问题
MySQL设置都没问题,而且JDBC版本也比较新,仍然出现了无法连接数据库的问题,错误如下:
java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306?
at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:327)
at org.gjt.mm.mysql.Connection.connectionInit(Connection.java:261)
at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89)
at org.gjt.mm.mysql.Driver.connect(Driver.java:167)
at java.sql.DriverManager.getConnection(DriverManager.java:523)
===========================================================
解决方法
把mm.mysql-2.0.4-bin.jar换成mysql-connector-java-3.1.5-gamma-bin.jar
下载地址
http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-3.1.5-gamma.zip/from/http://mirrors.hpcf.upr.edu/mysql/
java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306?
at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:327)
at org.gjt.mm.mysql.Connection.connectionInit(Connection.java:261)
at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89)
at org.gjt.mm.mysql.Driver.connect(Driver.java:167)
at java.sql.DriverManager.getConnection(DriverManager.java:523)
===========================================================
解决方法
把mm.mysql-2.0.4-bin.jar换成mysql-connector-java-3.1.5-gamma-bin.jar
下载地址
http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-3.1.5-gamma.zip/from/http://mirrors.hpcf.upr.edu/mysql/