创建配置单元表会自动更改mysql metastore的字符集设置
我将配置单元配置为使用mysql元存储。它很好用 但是,当我试图删除一个表时,我会出现如下错误创建配置单元表会自动更改mysql metastore的字符集设置,mysql,hadoop,integration,hive,meta,Mysql,Hadoop,Integration,Hive,Meta,我将配置单元配置为使用mysql元存储。它很好用 但是,当我试图删除一个表时,我会出现如下错误 FAILED: Error in metadata: javax.jdo.JDODataStoreException: Error(s) were found while auto-creating/validating the datastore for classes. The errors are printed in the log, and are attached to this exce
FAILED: Error in metadata: javax.jdo.JDODataStoreException: Error(s) were found while auto-creating/validating the datastore for classes. The errors are printed in the log, and are attached to this exception.
NestedThrowables:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
我做了一些研究,谷歌告诉我改变mysql字符集设置可以解决这个问题
我的mysql设置如下
mysql> show variables like '%char%';
+--------------------------+----------------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql/share/mysql/charsets/ |
+--------------------------+----------------------------------------+
8 rows in set (0.02 sec)
我将所有字符集设置从utf8
更改为latin1
,除了字符集文件系统
,字符集目录
即使这样做,我在尝试删除表时仍然会遇到相同的错误。
更糟糕的是,每当我创建一个新表时,mysql字符集设置都会重置为utf-8
有人能帮忙吗 问题在于,在hive-site.xml中,它在创建下面的“hive”时使用了其他数据库
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
</property>
javax.jdo.option.ConnectionURL
jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true
将您已经在mysql中创建的数据库名称更改为“metastore”,如下所示
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
</property>
javax.jdo.option.ConnectionURL
jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true
希望这个问题我也有同样的问题,我就这样解决了。
弗林德利马托克