Springbootプロジェクトピット

1648 ワード

  • Spring BootでJPAを使用してエラーを報告します:'hibernate.dialect'not setの解決策バージョンの問題、私のプロファイルApplication.yml、ファイルにdatabase-platform: org.hibernate.dialect.MySQL5Dialect
  • を追加
  • Caused by: com.mysql.cj.core.exceptions.I n v a l i d C o n nectionAttributeException:The server time zone...プロファイルApplication.ymlに追加:serverTimezone=UTC実はこれはspring boot+mybatisの問題ではありませんて、実はMySQL JDBCドライバの5.1を使うためです.33バージョンはUTCタイムゾーンと併用されており、接続文字列にserverTimezoneを明示的に指定する必要があります.
  • spring:
      datasource:
        driver-class-name: com.mysql.jdbc.Driver
        url: jdbc:mysql://localhost:3306/test?characterEncoding=utf-8&useSSL=false&autoReconnect=false&rewriteBatchedStatements=true&serverTimezone=UTC
        username: root
        password: 111
      jpa:
        database: mysql
        show-sql: true