1.异常信息
安装完hive配置好hive-site.xml文件之后报错java.sql.SQLException: null, message from server: “Host ‘master1’ is not allowed to connect to this MySQL server”
2.原因
因为安装好mysql之后没有给相应的ip配置mysql权限。
3.解决方案
- 进入mysql命令行界面:
use mysql;
select host,user,password from user;
- 如果配置的host不在user表中,使用如下命令给指定host配置权限:
grant all privileges on *.* to root@"指定host ip" identified by "密码";
flush privileges;