The last packet successfully received from the server was 2,272 milliseconds ago. The last packet sent successfully to the server was 2,258 milliseconds ago.


報錯

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 2,272 milliseconds ago.  The last packet sent successfully to the server was 2,258 milliseconds ago.
### The error may exist in pers/gs/dao/UserMapper.xml
### The error may involve pers.gs.dao.UserDao.getUserList
### The error occurred while executing a query
### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 2,272 milliseconds ago.  The last packet sent successfully to the server was 2,258 milliseconds ago.

原因

在網上查詢許多,沒有解決問題,最后考慮到我的數據庫連接字符串

jdbc:mysql://localhost:3306/mybatis?useSSL=true&userUnicode=true&characterEncoding=UTF-8

解決方法

useSSL=true改為useSSL=false


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM