### Error querying database.
Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 281 milliseconds ago. The last packet sent successfully to the server was 266 milliseconds ago.
### The error may exist in com/wang/dao/UserMapper.xml
### The error may involve com.wang.dao.UserDao.getUserList
### The error occurred while executing a query
### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
数据库配置如下:
maven配置:
mysql mysql-connector-java 5.1.46
两种原因导致这个问题
- mysql版本和驱动版本不匹配
讲mysql驱动配置改为
mysql mysql-connector-java 8.0.11
同时修改数据库配置:
我的mysql版本为8.0.25修改后还是报错
- SSL=true
不建议在没有服务器身份验证的情况下建立SSL连接。根据MySQL 5.5.45+、5.6.26+和5.7.6+的要求,如果不设置显式选项,则必须建立默认的SSL连接。您需要通过设置useSSL=false显式地禁用SSL,或者设置useSSL=true并为服务器证书验证提供信任存储
这边将修改useSSL=false 不再报错



