win2000下的mysql服务器启动问题

dxhxiaotian411 2005-01-24 01:26:49
各位朋友:
我安装的是mysql5.0安装完之后,我也把服务启动了就编了一个jsp文件测试一下,可是连不上数据库,下面是我的测试程序代码:
<%@ page contentType="text/html;charset=gb2312"%>
<%
java.sql.Connection conn;
java.lang.String strConn;
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn=java.sql.DriverManager.getConnection("jdbc:mysql://localhost/test","root","dai");
%>


下面的是出错信息:
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Communication failure during handshake. Is there a server running on localhost:3306?
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.test_jsp._jspService(test_jsp.java:57)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


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(Unknown Source)
org.gjt.mm.mysql.Driver.connect(Unknown Source)
java.sql.DriverManager.getConnection(DriverManager.java:512)
java.sql.DriverManager.getConnection(DriverManager.java:171)
org.apache.jsp.test_jsp._jspService(test_jsp.java:48)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.


--------------------------------------------------------------------------------
...全文
73 1 打赏 收藏 举报
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
trampwind 2005-01-24
mysql 服务启动了吧,不行的话尝试一下换个新的驱动试试,注意把驱动jar包放到你的工程类路径里,系统user表中要有对应访问配置,没的话可以:grant all on test.* root@localhost identified by 'dai';
  • 打赏
  • 举报
回复
相关推荐
发帖
MySQL
加入

5.6w+

社区成员

MySQL相关内容讨论专区
社区管理员
  • MySQL
申请成为版主
帖子事件
创建了帖子
2005-01-24 01:26
社区公告
暂无公告