hive启动时报错Caused by: javax.jdo.JDOFatalDataStoreException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://master:3306/hive?createDatabaseIfNotExist=true, username = root. Terminating connection pool
java.sql.SQLException: Access denied for user ‘root’@‘master’ (using password: YES)
我对这个错误的理解是,你设置的url没有连接mysql的权限,解决方法如下:
配置mysql远程登陆
在本机先使用root用户登录mysql:
mysql -u root -p 密码
进行授权操作:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
重载授权表:
FLUSH PRIVILEGES;
退出mysql数据库:
exit
在本机上通过Navicat修改user表权限
在命令行执行
update user set host='此处与你hive中配的url相同,我的就是master' where host='localhost';
执行flush privileges;
启动hive,至此问题应该解决了。