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%”;

更改完成啦!!!
本文解决IDEA连接MySQL数据库时报错的问题,错误信息涉及时区设置不正确。通过进入MySQL命令行,修改全局时区配置为'+8:00',实现中国标准时区的设置。
885

被折叠的 条评论
为什么被折叠?



