标题【报错】Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value ‘EDT’ is unrecognized or represents more than one time zone.
报错具体内容:
原因:mysql的时间与主机的时间不一致导致的
mysql -uroot -p111111 //启动mysql
在mysql中执行命令
select now(); //查看mysql当前时间
show variables like "%time_zone"; //查看mysql时区
time_zone说明mysql使用system的时区
system_time_zone说明system使用EST时区
解决方案: 修改时区
方法1.临时生效:
//在mysql中执行以下命令
set global time_zone = '+8:00';
set time_zone = '+8:00';
flush privileges; //立即生效
随后启动hive,即可成功
hive
临时的下次还要改
方法2 永久生效(建议):
修改my.cnf配置文件来修改时区
vim /etc/my.cnf
##在[mysqld]区域中加上
default-time_zone = '+8:00' //记得保存
service mysqld restart //生效mysql服务
启动hive
hive
okk!!!