学习mybatis过程中出现
org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
原因是在mybatis-config.xml文件中
在这一行
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useSSL=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8"/>
把useSSL=true改成 useSSL=false就可以了