数据库
首页 > 数据库> > 解决方案:mysql8以上版本时区问题: The server time zone value乱码XXXX异常

解决方案:mysql8以上版本时区问题: The server time zone value乱码XXXX异常

作者:互联网

异常:

Caused by: 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 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support.

解决方法:

链接URL后拼接参数serverTimezone=GMT
如: 

jdbc:mysql: //localhost:3306/db_spring?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT

或者

jdbc:mysql://localhost:3306/db_spring?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC

标签:XXXX,zone,serverTimezone,value,server,乱码,time,true
来源: https://www.cnblogs.com/bairentianshi/p/14969860.html