解决pycharm连接mysql报错: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.
一:修改my.ini文件
方式一:
[mysqld] 下面添加
default-time-zone='+8:00'
set global time_zone=’+8:00’
#serverTimezone=Asia/Shanghai
#set global time_zone=Asia/Shanghai

方式二:命令配置

二、pycharm的url设置 jdbc:mysql://localhost:3306/mysql?serverTimezone=Asia/Shanghai


三、连接成功

四、查询数据成功


浙公网安备 33010602011771号