搭建Hive远程模式在初始化Hive的时候报错Access denied for user ‘hiveowner‘@‘127.0.0.1‘ (using password: YES)

报错信息如下:

 

[root@bigdata11 conf]# schematool -dbType mysql -initSchema
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/training/apache-hive-2.3.0-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/training/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL:     jdbc:mysql://localhost:3306/hive?useSSL=false
Metastore Connection Driver :     com.mysql.jdbc.Driver
Metastore connection User:     hiveowner
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: java.sql.SQLException : Access denied for user 'hiveowner'@'127.0.0.1' (using password: YES)
SQL Error code: 1045
Use --verbose for detailed stacktrace.
*** schemaTool failed ***
根据报错信息可以看出时权限的问题

Access denied for user 'hiveowner'@'127.0.0.1' (using password: YES)
SQL Error code: 1045

查看MySQL用户表的权限

root@db 00:30:  [mysql]> select user,host,authentication_string from user;

修改hiveowner用户的权限

 root@db 02:07:  [mysql]> delete from user where user='hiveowner' and host='%';
root@db 02:07:  [mysql]> flush privileges;

root@db 02:07:  [mysql]> select user,host,authentication_string from user;

为了可以远程hiveowner用户,需要把此用户改为所有权限

root@db 02:07:  [mysql]> update user set host='%' where user='hiveowner';

root@db 02:15:  [mysql]> flush privileges;
root@db 02:15:  [mysql]> select user,host,authentication_string from user;


再次初始化hive

[root@bigdata11 conf]# schematool -dbType mysql -initSchema

证明已经初始化成功。

查看hive-schema-2.3.0.mysql.sql脚本

[root@bigdata11 apache-hive-2.3.0-bin]# find . -name hive-schema-2.3.0.mysql.sql

进到MySQL数据库中,查看在hive数据库的中初始化生成的表

或者使用Navicat for MySQL工具查看

通过以上的信息可以证明初始化成功

欢迎大佬们扫下面二维码关注我个人微信公众号(Java大数据架构师成长之路)

 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值