0
点赞
收藏
分享

微信扫一扫

Spring boot Mysql时区设置 The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than

  1. 运行报错

    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. 在这里插入图片描述

  2. 解决方法

    设置url: jdbc:mysql://localhost:3306/school?serverTimezone=Asia/Shanghai 或者设置url: jdbc:mysql://localhost:3306/school?serverTimezone=GMT%2B8 意为GMT+8(URL编码特殊字符%2B) 在这里插入图片描述

  3. 扩展设置 url: jdbc:mysql://localhost:3306/school?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&useSSL=true

举报

相关推荐

0 条评论