Specified key was too long; max key length is 767 bytes

在Hive里创建表时出现了错误:

FAILED: Execution Error, return code 1 from org.apache.Hadoop.hive.ql.exec.DDLTask. MetaException(message:javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 767 bytes
com.MySQL.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes

解决的办法是把数据库的Character Set改成latin1:

mysql > alter database hive character set latin1;
原文地址:https://www.cnblogs.com/mstk/p/6574006.html