I am using mysql with JSP deployed on tomcat server.
Whenever a few database operations are performed by the web application mysql stops and it starts giving the following error.

javax.servlet.ServletException: Communication failure during handshake. Is there a server running on localhost:3306?
org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:800)
org.apache.jsp.support.EmailHandler.grade2EmailEdi t_jsp._jspService(grade2EmailEdit_jsp.java:195)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet .java:856)


root cause

java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306?
org.gjt.mm.mysql.MysqlIO.init(Unknown Source)
org.gjt.mm.mysql.Connection.connectionInit(Unknown Source)
org.gjt.mm.mysql.jdbc2.Connection.connectionInit(U nknown Source)
org.gjt.mm.mysql.Driver.connect(Unknown Source)
java.sql.DriverManager.getConnection(DriverManager .java:512)
java.sql.DriverManager.getConnection(DriverManager .java:193
...
.....

Then i have to restart mysql and then it starts working fine for some time before it gives this error again.
Please suggest what could be the result of this problem