Caused by: java.sql.SQLException: Access denied for user 'root'@'wjn1' (using password: YES)

问题:MySQL拒绝该用户访问

解决:进入MySQL:grant all privileges on *.* to 'root'@'%' with grant option

上述方法不行,可能是hive-site-xml文件损坏

hive-site-xml下载

https://pan.baidu.com/s/1Ut3z_gBQtQh_250zrJ-oUA

密码:x4fs

踩到的坑

hive-site.xml文件中javax.jdo.option.ConnectionURL该属性配置时,value为localhost,以为是MySQL的服务器IP或者映射,所以就把localhost改了,导致无论怎么开启MySQL的远程访问权限,hive都无法访问,此处的localhost就是localhost,不能改,该属性如下,不要改localhost

javax.jdo.option.ConnectionURL

jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true

JDBC connect string for a JDBC metastore

不要改localhost!!!不要改localhost!!!

 

你可能感兴趣的:(数据库)