Mybatis-Plus报错:java.sql.SQLException: The server time zone value ‘�й���׼ʱ��‘ is unrecognized or repr

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.
Mybatis-Plus报错:java.sql.SQLException: The server time zone value ‘�й���׼ʱ��‘ is unrecognized or repr

方法一:在配置文件中url后加:&serverTimezone=GMT
如:url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
方法二:在配置文件中url后加:&serverTimezone=Asia/Shanghai
如:url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
方法三:在配置文件中url后加:&serverTimezone=GMT%2B8
如:url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
方法四:在配置文件中url后加:&serverTimezone=UTC
如:url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC

以上方法亲测有效

上一篇:Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ property manually.


下一篇:spring boot 连接数据库问题