zoukankan      html  css  js  c++  java
  • You must configure either the server or JDBC driver (via the serverTimezone configuration property

    使用JDBC连接MySql时出现: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

    错误提示:
    Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is 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.


    解决办法;
    在连接字符串后面加上?serverTimezone=UTC

    其中UTC是统一标准世界时间。

    完整的连接字符串示例:jdbc:mysql://localhost:3306/test?serverTimezone=UTC

    或者还有另一种选择:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8,这个是解决中文乱码输入问题,当然也可以和上面的一起结合:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
    ---------------------
    作者:编译人生
    来源:CSDN
    原文:https://blog.csdn.net/aayygg1234/article/details/78205240
    版权声明:本文为博主原创文章,转载请附上博文链接!

    spring.datasource.url = jdbc:mysql://127.0.0.1:3306/springboot_cache?setUnicode=true&characterEncoding=utf8&serverTimezone=UTC
  • 相关阅读:
    Android的LinearLayout中的权重android:layout_weight
    iPhone尺寸规范
    导出iPhone中安装的APP的iPA文件
    c++ json字符串转换成map管理
    mac 升级EI Capitan后遇到c++转lua时遇到libclang.dylib找不到的错
    sqlite3 数据库使用
    关于flyme5显示不到和卸载不到旧应用解决方法
    cocos2dx 通过jni调用安卓底层方法
    cocos2dx 单张图片加密
    安卓线程使用问题
  • 原文地址:https://www.cnblogs.com/wth21-1314/p/10616870.html
Copyright © 2011-2022 走看看