MyException - 我的异常网
输入您需解决的 软件开发问题并开始搜索, 我的异常网可以方便地提供各类 程序错误解决方案。
当前位置: 我的异常网 » Java Web开发

java.sql.SQLException:   Communication   failure  

奇怪的问题,求教达人!
我在IntelliJ   IDEA   里边运行单个的java类,就可以连接到mysql数据库,但是我编译后放在tomcat下就会出现这个错误,
java.sql.SQLException:   Communication   failure   during   handshake.   Is   there   a   server
  running   on   localhost:3306?
                at   org.gjt.mm.mysql.MysqlIO.init(Unknown   Source)
                at   org.gjt.mm.mysql.Connection.connectionInit(Unknown   Source)
....
怎么会有这个错误的?
我的mysql明明运行的好好的

------解决方案--------------------------------------------------------
Is there a server
running on localhost:3306?
没看到吗?端口问题!建议把端口改了@
软件开发 程序错误 异常 Exception Copyright © 2009-2012 MyException 版权所有