java.sql.SQLException: Unknown system variable
mysql-connecter-java的版本过低,很显然是数据库驱动程序与数据库版本不对应.
query cache在MySQL5.7.20就已经过时了,而在MySQL8.0之后就已经被移除了.
如 mybatis使用 mysql-5.1.14的驱动程序,而mybatis配置的数据源连接的是 mysql-8.0.11,修改 pom文件中mysql-connector-java为新版本即可
The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone.
因为新版MySQL用了统一的时区管理,时区一致便与维护 ,避免PDT时区换算出错
解决办法:
spring.datasource.url=jdbc:mysql://localhost:3306/spring_cache?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
mysql> show variables like '%time_zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | |
| time_zone | +: |
+------------------+--------+
rows in set, warning (. sec)
mysql> set global time_zone='+:';
Query OK, rows affected (. sec)