Mysql的时区错误问题

  • JDBC连接数据库报错:
java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.

You must configure either the server or JDBC driver

(via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
  • 解决:
mysql> show variables like '%time_zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | |
| time_zone | SYSTEM |
+------------------+--------+
2 rows in set, 1 warning (0.00 sec)

mysql> set global time_zone='+8:00';
Query OK, 0 rows affected (0.00 sec)
原文地址:https://www.cnblogs.com/LJing21/p/9707202.html