Today, when I was learning mybatis, I always reported an error when executing the query operation! The error is as follows:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
It probably means that there is a problem with the database connection. After checking the database name, user name and password, there are no errors. Some blogs say that they need to change the MySQL configuration file. I really think it’s too troublesome to change
Solution:
A blog commented that if MySQL is version 8.0 or above, usessl in the configuration should be set to false
and then it will be
useSSL=true