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