java.sql.SQLException: Communication failure during handshake. Is there a server running on localhos

错误如下:

java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306? at com.mysql.jdbc.MysqlIO.init(Unknown Source) at com.mysql.jdbc.Connection.connectionInit(Unknown Source) at com.mysql.jdbc.jdbc2.Connection.connectionInit(Unknown Source) at com.mysql.jdbc.Driver.connect(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at com.foofy.org.DbConnection1.DbConn(DbConnection1.java:28) at com.authentication.org.SignUp1.doGet(SignUp1.java:56) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:404) at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source)
解决思路:

Driver classes are loaded successfully by JVM, The exact problem is that you are using latest mysql server but old version of mysql connecter jar.

Recommendation:

Go to download mysql connectro http://dev.mysql.com/downloads/connector/j/3.1.html/and download latest driver and put that to your WEB-INF/lib directory, restart the server

Good luck.

你可能感兴趣的:(java.sql.SQLException: Communication failure during handshake. Is there a server running on localhos)