Pycharm 连接 MySQL 时报错java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä'...

问题:

通过Pycharm 中的database 连接本地的MSQL数据库碰到报错,如下:
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 server Timezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

分析:

因为安装mysql的时候时区设置的不正确 mysql默认的是美国的时区,而我们中国大陆要比他们迟8小时,采用+8:00格式

解决:

set global time_zone='+8:00'

参考文章:

[幕三少](https://www.cnblogs.com/smiler/p/9983146.html

转载于:https://www.jianshu.com/p/a02c7d8731e1

猜你喜欢

转载自blog.csdn.net/weixin_33736832/article/details/91159303
今日推荐