hive 建表报错 For direct MetaStore DB connections, we don't support retries at the client level

来源:互联网 发布:免费音乐相册制作软件 编辑:程序博客网 时间:2024/05/16 06:53
hive 已经有建表语句,然后导入建表, 以下是过程

[root@master exercise]# hive -f /opt/exercise/visits.hive

Logging initialized using configuration in jar:file:/opt/apache-hive-1.2.2-bin/lib/hive-common-1.2.2.jar!/hive-log4j.properties
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:For direct MetaStore DB connections, we don't support retries at the client level.)


这个是因为hive用到的mysql 连接包版本不匹配的原因。 我安装的mysql 是 5.6.33,从网络上下载了一个mysql-connector-Java-5.1.36.jar,替换,重启hive,问题解决。



我下载了mysql-connector-java-5.1.25-bin 没用 !!!


重启hive :???命令是什么


语义异常:这是因为字符集造成的
  1. alter database hive character set latin1

查看字符集?
[root@master ~]# show variables like '%char%'
bash: show: command not found

我的字符集是UTF8 ,不知道HIVE 字符集是什么
MYSQL 用hive 用户也登录不上 !


[root@master ~]# mysql -h master -uhive
ERROR 1045 (28000): Access denied for user 'hive'@'master' (using password: NO)

mysql> update user set password=PASSWORD(hive) where user='hive';
ERROR 1046 (3D000): No database selected


用这个命令登录:
mysql -uhive -h master -p

回到继续字符集问题:
Hive默认是所有文件都是UTF8的。hive将按照UTF8编码格式对数据文件进行解析和查询。
。。。。

不知道咋办了


[root@master ~]# hive -f /opt/exercise/visits.hive

Logging initialized using configuration in jar:file:/opt/apache-hive-1.2.2-bin/lib/hive-common-1.2.2.jar!/hive-log4j.properties
OK
Time taken: 1.327 seconds
竟然可以了!!!!!!!


解决方案:



mysql> alter database hive character set latin1;
Query OK, 1 row affected (0.07 sec)



为什么用拉丁文, 真心不懂, UTF8 不行呀????




阅读全文
1 0
原创粉丝点击