首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

java.sql.SQLException: Communication failure

2011-11-25 
奇怪的问题,求教达人!我在IntelliJIDEA里边运行单个的java类,就可以连接到mysql数据库,但是我编译后放在to

奇怪的问题,求教达人!
我在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?
没看到吗?端口问题!建议把端口改了@

热点排行