![ed46bf1e6902e9c1a2b7fbfd866694ce.png](https://i-blog.csdnimg.cn/blog_migrate/b7f15dab33a6fd39bd089b610f0db846.png)
问题一:权限问题
![7a3796cb240c5625c6b8d2f2f4ad5673.png](https://i-blog.csdnimg.cn/blog_migrate/436dfd746a58adb5ab41b4203f83e9d8.png)
解决:修改权限
![1f9b028b494357e8d2dd227a6d40a1b1.png](https://i-blog.csdnimg.cn/blog_migrate/a61a1d22b992586fcd7e55fcb10c80e0.png)
问题二:密码问题
![7983bc5a0bc34f4a228f81fc5ec67b5c.png](https://i-blog.csdnimg.cn/blog_migrate/8221293c36c66b60e5703dcb1a306299.png)
我的主机是master 账户是hive 密码是hive
![84bd3dce464cbc2307ff65b76e95d7e3.png](https://i-blog.csdnimg.cn/blog_migrate/e78ba63410e812892afd8eb2670b472d.png)
![b45346c265cfe7846cb2edf63abe6cc1.png](https://i-blog.csdnimg.cn/blog_migrate/21c5416640c957663c44fc876533623f.png)
用密码登录无法登录
![1f8aaa521061e6589109a817610c2d6b.png](https://i-blog.csdnimg.cn/blog_migrate/32d72a7cc8a22fd73a89234ea02d06dd.png)
我们检查一下
select user,host,password from mysql.user;
![823852d2f8bdc2339863a236bae23fef.png](https://i-blog.csdnimg.cn/blog_migrate/3a4ed5b27e76369c5cc7200287391b8a.png)
我们删除这里面的一些数据,然后重新赋权限
- 删除用户为空的
use mysql
select host,user from user;
![42c656d6749958c698d46e43b14e53f2.png](https://i-blog.csdnimg.cn/blog_migrate/6659a97f878f97512cf6beab916f77fd.png)
delete from user where user=' ';
commit;
select host,user from user;
![133410daa02d338c7e50088960670da2.png](https://i-blog.csdnimg.cn/blog_migrate/f929b7de1abc272f11e099a5cf5a2c31.png)
- 删除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;
![4f4c95a0203341a01677f5ce5d0cb8cf.png](https://i-blog.csdnimg.cn/blog_migrate/7d6348fe12b9c882ea7e9cde45686371.png)
删除hive用户
delete from user where user='hive';
select host,user from user;
![ef714d17985d750f3bd4125c5ecacf15.png](https://i-blog.csdnimg.cn/blog_migrate/1e9e20d3762c9a398ee95705f1e3437d.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;
![d04563c96cdb67020e60ab00e6b783f3.png](https://i-blog.csdnimg.cn/blog_migrate/47e3b1ba92dbbcd3ed929c44c40e2121.png)
再次执行schematool -dbType mysql –initSchema成功初始化
![baf6aedffff94401632d2a8d6ce383bd.png](https://i-blog.csdnimg.cn/blog_migrate/8bdd7f81431a8ba0a7ade9cbbc7c09d9.png)