zoukankan      html  css  js  c++  java
  • spring boot启动异常: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

    项目启动时提示: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.

    yml配置

    spring:
      profiles:
        active: dev
    
      datasource:
        driver-class-name: com.mysql.cj.jdbc.Driver
        url: jdbc:mysql://127.0.0.1:3306/mydb?useUnicode=true&characterEncoding=utf8
        username: eric
        password: 123456
    
      jpa:
        hibernate:
          ddl-auto: create
        show-sql: true
    解决方案1
    在mysql中执行命令: 
    set global time_zone='+8:00' 
    解决方案2
    修改application.properties数据库配置,添加serverTimezone=UTC:
    url:jdbc:mysql://localhost:3306/mydb?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC
  • 相关阅读:
    什么是 CLR
    常用的数据结构以及算法
    Array和ArrayList的异同点
    什么是CMS?
    .NET Framework3.0答疑
    C#中的委托
    C#速成之三(Quick C#)
    C#速成之五(Quick C#)
    C#速成之四(Quick C#)
    类,对象,封装,接口,多态,继承
  • 原文地址:https://www.cnblogs.com/ssjf/p/11446797.html
Copyright © 2011-2022 走看看