美文网首页
Pycharm 连接 MySQL 时报错java.sql.SQL

Pycharm 连接 MySQL 时报错java.sql.SQL

作者: wanggs66 | 来源:发表于2019-06-02 23:25 被阅读0次

问题:

通过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

相关文章

网友评论

      本文标题:Pycharm 连接 MySQL 时报错java.sql.SQL

      本文链接:https://www.haomeiwen.com/subject/itofxctx.html