mybatis-PersistenceException-MySQLNonTransientConnectionException: Could not create connection to database server
可能原因
-
jar包版本问题
-
mysql-connector-java版本不匹配
-
mysql -uroot -p 查看版本号
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 71 Server version: 8.0.16 MySQL Community Server - GPL
-
关键报错:
- According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+
- Could not create connection
-
更改版本号后正常运行
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.46</version> </dependency>
报错信息
Thu Apr 09 00:04:39 CST 2020 WARN: Establishing SSL connection without server's identity verif