日期:2014-05-18  浏览次数:20739 次

Tomcat不能连接MYSQL
我是菜鸟,安装好了MYSQL数据库,起动TOMCAT,显示以下错误的信息:
2007-6-14   18:41:23   org.logicalcobwebs.proxool.Prototyper   sweep
严重:   Prototype
java.sql.SQLException:   Unable   to   connect   to   any   hosts   due   to   exception:   java.net
.ConnectException:   Connection   refused:   connect

**   BEGIN   NESTED   EXCEPTION   **

java.net.ConnectException
MESSAGE:   Connection   refused:   connect

STACKTRACE:

java.net.ConnectException:   Connection   refused:   connect
                at   java.net.PlainSocketImpl.socketConnect(Native   Method)
                at   java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                at   java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                at   java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                at   java.net.Socket.connect(Socket.java:452)
                at   java.net.Socket.connect(Socket.java:402)
                at   java.net.Socket. <init> (Socket.java:309)
                at   java.net.Socket. <init> (Socket.java:124)
                at   com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
va:124)
                at   com.mysql.jdbc.MysqlIO. <init> (MysqlIO.java:225)
                at   com.mysql.jdbc.Connection.createNewIO(Connection.java:1783)
                at   com.mysql.jdbc.Connection. <init> (Connection.java:450)
                at   com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:411)
                at   java.sql.DriverManager.getConnection(DriverManager.java:512)
                at   java.sql.DriverManager.getConnection(DriverManager.java:140)
                at   org.logicalcobwebs.proxool.ProxyFactory.buildProxyConnection(ProxyFac
tory.java:41)
                at   org.logicalcobwebs.proxool.Prototyper.buildConnection(Prototyper.java
:150)
                at   org.logicalcobwebs.proxool.Prototyper.sweep(Prototyper.java:95)
                at   org.logicalcobwebs.proxool.PrototyperThread.run(PrototyperThread.java
:42)


**   END   NESTED   EXCEPTION   **


                at   com.mysql.jdbc.Connection.createNewIO(Connection.java:1851)