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
Read More:
- [Solved] Druid connection pooling Error: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
- [Solved] MYSQL Connect Error: Communications link failure
- [Solved] MySQL connection error: communications link failure
- MySQL Change password failure prompt: ERROR 1064(42000):You have an error in your SQL syntax: check the corresponds to your M
- Problems in connecting mysql8.0 in IDEA [How to Solve]
- Docker mysql8 modify password
- [Solved] Sqlyog always reports an error when creating a new connection.
- [Solved] init datasource error, url: jdbc:mysql://lcoalhost:3306/test com.mysql.cj.jdbc.exceptions.Com
- Using Mybatis to connect to the database error: Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver···
- How to Solve c3p0 connect mysql8.0 Error
- [Solved] Description: Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded
- [Solved] Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as
- ERROR 1054(42S22) Unknown column ‘password’ in ‘field list’ (Fixed)
- [Solved] Worker 1 failed executing transaction ‘ANONYMOUS‘ at master log mall-mysql-bin.000001, end_log_pos
- [Solved] ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost‘
- [Solved] public key is not available client side (option serverRsaPublicKeyFile not set)
- [Solved] com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
- Android connection to cloud MySQL error: java.lang.NoClassDefFoundError Failed resolution of LjavasqlSQLType
- Springboot error: “errorcode 1045, state 28000” [How to Solve]
- Mysql5.7.18.1 Error 1054 (42S22): Unknown Column’password’ In’field List’ When Changing User Password