初始化hive时报错:org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version

执行hive初始化(schematool -dbType mysql -initSchema )时一直报错:

org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: java.sql.SQLException : Access denied for user 'root'@'single01' (using password: YES)
SQL Error code: 1045

报错显示无法登录Mysql

初始化hive时报错:org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version

1、查看配置文件vim conf/hive-site.xml,检查mysql密码是否写错,排除此原因。

2、尝试直接登录Mysql,检查本机登录密码是否有问题,排除此原因。

初始化hive时报错:org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version

3、最后发现mysql远程登录密码与本机登录密码不一致,修改一致

修改方法:使用本机登录mysql

输入show databases ; 查看是否有mysql库

初始化hive时报错:org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version

mysql> use mysql;

mysql> grant all on *.* to root@'%' identified by '新密码';

初始化hive时报错:org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version

再次初始化hive:[root@xxxx ~]# schematool -dbType mysql -initSchema

本次提示:Initialization script completed!!完成

上一篇:spring boot 读取启动配置类的流程、原理


下一篇:MapReduce 订单和商品pid替换(Reduce Join)基本实现