mysql常见问题及解决方法

1.mybatis连接mysql数据库时,出现错误:

Tue Sep 17 19:18:17 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2019-09-17 19:18:17.181 [http-nio-8888-exec-9] ERROR org.apache.tomcat.jdbc.pool.ConnectionPool - Unable to create initial connections of pool.
java.sql.SQLException: Unknown system variable 'query_cache_size'

解决方案:

(1).断开springboot,修改application.yml文件:

url: jdbc:mysql://localhost:3306/course?characterEncoding=utf-8&useSSL=false&serverTimezone=GMT

username: root

password:123456

(2).重新启动springboot,问题解决,同时需要注意修改时区为serverTimezone=GMT,pom文件中mysql-connector-java版本要与安装的mysql版本一致;

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.17</version>
</dependency>

 

posted @ 2019-09-17 20:31  maxwell11  阅读(765)  评论(0编辑  收藏  举报