• 三、SpringBoot启动时JDBC报错:You must configure either the server or JDBC driver (via the serverTimezone configuration property)


    错误提示:

    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

  • 相关阅读:
    mongoDB安装配置
    linux-批量修改目录下后缀shell
    备份mysql的shell
    mysql_DML_索引、视图
    mysql_存储过程
    mysql_备份_mysqldump
    mysql_DCL_grant/revoke
    mysql_DML_select_子查询
    mysql_DML_select_union
    mysql_DML_select_聚合join
  • 原文地址:https://www.cnblogs.com/chushujin/p/11835063.html
Copyright © 2020-2023  润新知