解决错误The server time zone value ‘й׼ʱ’ is unrecognized or represents more than one time zone.

  • 错误全文:
    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.
  • 错误原因:springboot启动项目时报错,这是jdbc6.0以上出现的问题,因为在application.properties没有创建serverTimezone;
  • 改正方法:修改application.properties中url属性如下:
spring.datasource.url=jdbc:mysql:///vhr?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
  • 其中属性意义:
    • useUnicode=true 表示使用Unicode字符,可以使用中文;
    • characterEncoding=utf-8 编码方式;
    • serverTimezone=UTC 设置全球标准时间。


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部