首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

hive初始化访问mysql权限有关问题

2013-10-07 
hive初始化访问mysql权限问题hive 执行 show tables问题写道FAILED: Error in metadata: javax.jdo.JDOFa

hive初始化访问mysql权限问题

hive 执行 show tables;

问题

写道FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Access denied for user 'hive'@'localhost' (using password: YES)
NestedThrowables:
java.sql.SQLException: Access denied for user 'hive'@'localhost' (using password: YES)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

?然后启动 bin/hive,执行show tables命令 这时报FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Access denied for user 'hive'@'localhost' (using password: YES)。这是因为mysql不允许远程访问的问题,执行?

?

GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost' IDENTIFIED BY 'hive' WITH GRANT OPTION;

FLUSH PRIVILEGES;

允许用户hive从ip为localhost的主机连接到mysql服务器,并使用hive作为密码

?

?

然后再执行show tables命令,这时报:FAILED: Error in metadata: javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 767 bytes。?
这个问题是因为hive对mysql的UTF-8编码方式有限制,修改一下mysql的编码方式即可:alter database name character set latin1;

热点排行