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表删除。
重启启动hive
修改hive字符集
alter database hive character set latin1;
再插入就成功了。
当mysql的字符集设置成utf8的时候使用hive会有问题
所以当hive使用mysql作为元数据库的时候mysql的字符集要设置成latin1。
因为MySQL通过my.cnf一般情况下设置为utf-8编码,因此需要在创建Hive元数据库时,需要将MySQL中的hive库改回latin1。
参考:https://www.cnblogs.com/wangrd/articles/6392116.html
hive元数据储存在mysql 字符集utf8 修改
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://IP:3306/hive?createDatabaseIfNotExist=true&characterEncoding=UTF-8<value>
</property>
然后启动hive