hive的元數據存儲在mysql後,報錯的解決方法!

 


因爲要實現多人開發Hive,所以需要將hive的元數據存儲在mysql。配置完成後,配置之前hive中創建的數據表在show tables時都不會出現,但hdfs數據文件都還在。

當在hive中drop table 時如果報以下錯時

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中的hive數據庫裏執行 alter database hive character set latin1;改變hive元數據庫的字符集,問題就可以解決!

發佈了178 篇原創文章 · 獲贊 7 · 訪問量 32萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章