hive施用mysql保存metastore
hive使用mysql保存metastoreHive 将元数据存储在 RDBMS 中,有三种模式可以连接到数据库:1)ingle User Mode
hive使用mysql保存metastore
Hive 将元数据存储在 RDBMS 中,有三种模式可以连接到数据库:
1)ingle User Mode: 此模式连接到一个 In-memory 的数据库 Derby,一般用于 Unit Test。
2)Multi User Mode:通过网络连接到一个数据库中,是最经常使用到的模式。
3)Remote Server Mode:用于非 Java 客户端访问元数据库,在服务器端启动一个 MetaStoreServer,客户端利用 Thrift 协议通过 MetaStoreServer 访问元数据库。
Hive默认是采用Derby来存储其Meta信息的,
现在我们需要修改为mysql
1.在mysql专门为hive添加用户
bin/hivehive> show tables;
When using MySQL as a metastore I see the error "com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes".
* This is a known limitation of MySQL 5.0 and UTF8 databases. One option is to use another character set, such as 'latin1', which is known to work.
Hive用MySQL做元数据保存的数据库时,mySQL设置
http://running.iteye.com/blog/910277 1 楼 cooler1217 2012-06-01 alter database hive character set latin1
然后重启,就ok