zoukankan      html  css  js  c++  java
  • mysql8报错解析

    1. 场景描述

    想把测试数据导一份到本地使用,乱入装了mysql8,使用springboot项目启动的时候报:

    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.
    	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.15.jar:8.0.15]
    	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.15.jar:8.0.15]
    

    2.解决方案

    在jdbc连接上增加参数配置:&serverTimezone=GMT%2B8

    spring.datasource.url=jdbc:mysql://localhost:3306/shiro?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
    

    增加的是时区设置,至于为什么是GMT%2B8,据说是为了解析不乱码,不纠结。


    I’m 「软件老王」,如果觉得还可以的话,关注下呗,后续更新秒知!欢迎讨论区、同名公众号留言交流!

  • 相关阅读:
    CentOS 7.3 CDH 5.10.0 Druid0.12.4安装记录
    cloudera manager卸载流程
    CDH5.10.0 离线安装(共3节点) 转
    CentOS 7 安装Httpd(转)
    CentOS下MySQL的彻底卸载
    CentOS7 修改主机名
    sendEvent()
    QSignalMapper Class
    ubuntu12.04开启虚拟机的unity模式
    BCM_I2C函数更改
  • 原文地址:https://www.cnblogs.com/ruanjianlaowang/p/11246539.html
Copyright © 2011-2022 走看看