mybatis使用idea连接数据库报错的奇葩问题


ERROR QUERYING DATABASE.  CAUSE: COM.MYSQL.JDBC.EXCEPTIONS.JDBC4.COMMUNICATIONSEXCEPTION: COMMUNICAT

标签: mybatis

 在第一个mybatis程序时:错误

org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 7,200 milliseconds ago.  The last packet sent successfully to the server was 7,195 milliseconds ago.
### The error may exist in com/kuang/dao/UserMapper.xml
### The error may involve com.kuang.dao.UserDao.getUserList
### The error occurred while executing a query
### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

  1. org.apache.ibatis.exceptions.PersistenceException: 
  2. ### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  3.  
  4. The last packet successfully received from the server was 7,200 milliseconds ago.  The last packet sent successfully to the server was 7,195 milliseconds ago.
  5. ### The error may exist in com/kuang/dao/UserMapper.xml
  6. ### The error may involve com.kuang.dao.UserDao.getUserList
  7. ### The error occurred while executing a query
  8. ### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

解决:

将URL中的:useSSL=true

改为:useSSL=false


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM