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

  • 相关阅读:
    言多必失失在哪?
    C/C++四种方法实现加法操作_艾孜尔江撰
    VS Code添加到右键菜单_艾孜尔江撰
    网页端UVC相机测试_艾孜尔江撰
    Python爬虫示例
    Java制作软光栅化渲染器_艾孜尔江撰
    指针常量与常量指针
    C/C++中Main之后执行的函数_艾孜尔江撰
    Token机制 ——JSON Web Token(JWT)的详解
    Excel-实现隔行设置背景色
  • 原文地址:https://www.cnblogs.com/zqzhen/p/12894299.html
Copyright © 2011-2022 走看看