近日在配置hive连接本机mysql服务,初始化出现报错,
信息:
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: java.sql.SQLException : null, message from server: "Host '192.168.31.1' is not allowed to connect to this MySQL server"
如下图:
百度得知这是本地mysql 远程登陆用户权限问题;需要修改用户权限即可!
具体操作如下:
step1:
1、授权
(1)设置用户root可以在本地被访问:grant all privileges on *.* to root@"localhost" identified by "新密码"
(2)刷新权限使之生效: flush privileges;
2、删除本机上对应的主机信息:
use mysql;
select host,user from user;
drop user 'username'@'host';
完成两部操作后重启mysql服务
再次初始化hive,即可!
参考博客连接:https://blog.csdn.net/u013982921/article/details/80956164