title: java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306?
body: <p>I am running servlet file in eclipse using tomcat6. When running my file it shows the following error :</p>
  
  <blockquote>
    <p>Error
    processing resource'http://localhost/MyFirstDynaSer/SignUp...<br>
    java.sql.SQLException: Communication failure during handshake. Is
    there a server running on localhost:3306?"</p>
  </blockquote>
  
  <p>What would be my mistake? Could anybody help me.. This is my web.xml file.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt;
  &lt;servlet&gt; 
      &lt;servlet-name&gt;SignUp&lt;/servlet-name&gt; 
      &lt;servlet-class&gt;com.authentication.org.SignUp&lt;/servlet-class&gt; 
    &lt;/servlet&gt; 
    &lt;servlet-mapping&gt; 
      &lt;servlet-name&gt;SignUp&lt;/servlet-name&gt; 
      &lt;url-pattern&gt;/SignUp&lt;/url-pattern&gt; 
    &lt;/servlet-mapping&gt; 
    &lt;display-name&gt;MyFirstDynaSer&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>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)
  java.lang.NullPointerException
      at com.authentication.org.SignUp1.doGet(SignUp1.java:74)
      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)
  </code></pre>