jsp链接mysql时出现端口链接不到

04-02-03 deke21

出现的错误信息:

org.apache.jasper.JasperException: Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.security.AccessControlException)

at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)

at org.apache.jasper.servlet.JspServlet.service(Unknown Source)

at javax.servlet.http.HttpServlet.service(HttpServlet.java)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)

at org.apache.catalina.core.ApplicationFilterChain.access$0(Unknown Source)

at org.apache.catalina.core.ApplicationFilterChain$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)

at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)

at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)

at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)

at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)

at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)

at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)

at org.apache.catalina.core.StandardContext.invoke(Unknown Source)

at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)

at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)

at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)

at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)

at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)

at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)

at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)

at java.lang.Thread.run(Thread.java:536)

也试过用127.0.0.1:3306和IP:3306

结果都是一样。

org.apache.jasper.JasperException: Cannot connect to MySQL server on 127.0.0.1:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.security.AccessControlException)

服务器安装有:tomcat,apache,mysql,

用netstat -antp 可以看到里面有3306端口已经启动了。

请教一下,这是什么问题?如何解决?

谢谢!

i_love_this_game
2004-02-03 13:48

Two possiblity:

1. user name or password is wrong

2. port 3306 is taken by another process. You can use mySQL control center to check it's really running