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