zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    [zoj3627]模拟吧
    [zoj3623]背包模型
    [hdu4358]树状数组
    [hdu1272]并查集
    [hdu3308]线段树
    [hdu5033]单调队列
    [hdu1506]单调队列(栈)
    [hdu2888]二维RMQ
    [hdu4123]dfs区间化+RMQ
    [hdu1242]优先队列
  • 原文地址:https://www.cnblogs.com/shihaiming/p/5857608.html
Copyright © 2011-2022 走看看