问题一:权限问题
![e39f97f90f93d42cc33dacaa52489cf7.png](https://img-blog.csdnimg.cn/img_convert/e39f97f90f93d42cc33dacaa52489cf7.png)
解决:修改权限
![b898cfdd947f63842962d28a928212ee.png](https://img-blog.csdnimg.cn/img_convert/b898cfdd947f63842962d28a928212ee.png)
问题二:密码问题
![190e2a7d812e51ece184b1b1076a712b.png](https://img-blog.csdnimg.cn/img_convert/190e2a7d812e51ece184b1b1076a712b.png)
我的主机是master 账户是hive 密码是hive
![749585eef230a9335a7dbf662bb6de85.png](https://img-blog.csdnimg.cn/img_convert/749585eef230a9335a7dbf662bb6de85.png)
![cff697ce14d287696214cc5763ef5960.png](https://img-blog.csdnimg.cn/img_convert/cff697ce14d287696214cc5763ef5960.png)
用密码登录无法登录
![a156a2a25a66751647879db883a1bbec.png](https://img-blog.csdnimg.cn/img_convert/a156a2a25a66751647879db883a1bbec.png)
我们检查一下
select user,host,password from mysql.user;
![6dadd81e50ae8b3a0fe8f535347944fe.png](https://img-blog.csdnimg.cn/img_convert/6dadd81e50ae8b3a0fe8f535347944fe.png)
我们删除这里面的一些数据,然后重新赋权限
(1) 删除用户为空的
use mysql
select host,user from user;
![24c2c8bd04ffefab0b9b7d036f581c48.png](https://img-blog.csdnimg.cn/img_convert/24c2c8bd04ffefab0b9b7d036f581c48.png)
delete from user where user=' ';
commit;
select host,user from user;
![8388184ac9b7a1d04accd85d32c3c8d7.png](https://img-blog.csdnimg.cn/img_convert/8388184ac9b7a1d04accd85d32c3c8d7.png)
(2) 删除localhost和127.0.0.1
delete from user where host='127.0.0.1';
delete from user where host='localhost';
commit;
select host,user from user;
![e52de5d82f8cc575be874d0feab132f3.png](https://img-blog.csdnimg.cn/img_convert/e52de5d82f8cc575be874d0feab132f3.png)
删除hive用户
delete from user where user='hive';
select host,user from user;
![4e646be77c015fe4ce28836b47351522.png](https://img-blog.csdnimg.cn/img_convert/4e646be77c015fe4ce28836b47351522.png)
grant all privileges on hive.* to hive@'%' identified by 'hive' with grant option;
grant all privileges on hive.* to hive@'master' identified by 'hive' with grant option;
grant all privileges on hive.* to hive@'localhost' identified by 'hive' with grant option;select host,user from user;
![f82b90a44d255c22f82ce430aded497b.png](https://img-blog.csdnimg.cn/img_convert/f82b90a44d255c22f82ce430aded497b.png)
再次执行schematool -dbType mysql –initSchema成功初始化
![fdd6fc3a350e1791fad31fff978dbe4a.png](https://img-blog.csdnimg.cn/img_convert/fdd6fc3a350e1791fad31fff978dbe4a.png)