idea连接数据库报错误:
com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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
命令提示符进入mysql :mysql>mysql -u用户名 -p密码; -
更改时区
mysql> show variables like “%time_zone%”;
mysql> set global time_zone=’+8:00’;
-
退出数据库重新进入
mysql> show variables like “%time_zone%”;
更改完成啦!!!