zoukankan      html  css  js  c++  java
  • The server time zone value 'EDT' is unrecognized or represents more than one time zone.

    问题:

    启动hive时出现以下错误:

    Caused by: java.sql.SQLException: The server time zone value 'EDT' 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:545)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:505)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:479)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:489)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:69)
    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1606)
    at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:633)
    at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:347)
    at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:219)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:361)
    at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:416)
    ... 70 more

    解决:

    (1)使用 server mysql start命令启动mysql

    (2)在mysql中执行show variables like '%time_zone%';

    (3)输入select now();

    (4)在终端执行date命令

    此时发现终端显示的时间和MySql中显示的时间不一致,这就是问题所在。

    (5)在mysql中执行 set time_zone=SYSTEM;

    (6)再次在mysql中执行select now();

     

    (6)执行 set global time_zone='+8:00';

    (7)执行 flush privileges;

    (7)再次执行hive命令,问题解决。

    原文链接:https://blog.csdn.net/u014662563/article/details/61923884

  • 相关阅读:
    java中的静态代理、jdk动态代理和cglib动态代理
    第三方支付熟悉
    C#进制转换
    维翔主机asp主机使用遇到的问题及解决方案总结
    windows上JSP开发环境全搭建
    文件校验工具的开发及问题
    C#加密算法总结
    WampServer搭建php环境可能遇到的问题
    分分钟搭建自己的微信聊天机器人
    KindEditor编辑器在ASP.NET中的使用
  • 原文地址:https://www.cnblogs.com/zqzhen/p/12894299.html
Copyright © 2011-2022 走看看