• mysql-connector-java升级到6.0以后启动tomcat报错


    mysql-connector-java升级到6.0以后启动tomcat报错

    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.

    解决办法

    在连接的url后加一个参数 serverTimezone=GMT (加了这个参数之后就能顺利链接数据库了),这里的时区可以根据自己数据库的设定来设置。

    之后还可能会出现另一个错误,mysql新的安全性设置要求SSL连接,此处可以加一个参数userSSL=false,或者自己设置SSL也可以 

    另外,6.0.2版本的driverClassName不再是原来的路径,改成com.mysql.cj.jdbc.Driver了

    示例:

    jdbc.driverClassName=com.mysql.cj.jdbc.Driver

    jdbc.url=jdbc:mysql://192.168.1.2:3306/test?serverTimezone=GMT&useSSL=false

  • 相关阅读:
    shell test条件判断
    shell 变量
    shell 流程结构
    shell 正则表达式
    shell脚本常用参数
    snmp 简单的网络管理协议
    linux
    nmap
    git 基础操作
    linux 下 svn 更新代码
  • 原文地址:https://www.cnblogs.com/shihaiming/p/5857608.html
Copyright © 2020-2023  润新知