读书人

java.sql.SQLException: Communicati

发布时间: 2011-11-25 21:31:10 作者: rapoo

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

读书人网 >Java Web开发

热点推荐