服务器mysql 版本和mysql-connector-java版本冲突

报错误信息

org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)

原因:本地测试连接的mysql数据库版本5.7,生产上用的还是老版本的mysql 5.6,包冲突了

解决:

pom.xml

mysql mysql-connector-java 5.1.9

改成5.1.40

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容