报错:Cannot create PoolableConnectionFactory (The server time zone value 'CST' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverT

报错:Cannot create PoolableConnectionFactory (The server time zone value 'CST' 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.)
---------------------
由于我的是win7系统,如下:

解决时区问题:

方法一:修改驱动:
jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=gbk&useSSL=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Hongkong

方法二:修改数据的时区:
select now(); 查看mysql系统时间。和当前时间做对比

set global time_zone = '+8:00';设置时区更改为东八区

flush privileges; 刷新权限

然后退出后重新登录就可以了,显示当前时间和我现在的时间一致了。

猜你喜欢

转载自www.cnblogs.com/wangjq399/p/10693313.html