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 1,635 milliseconds ago. The last packet sent successfully to the server was 1,626 milliseconds ago.
解决方法:
url后面加上useSSL=false
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useSSL=false&useUnicode=true&characterEncoding=UTF-8"/>