ambari安装hive检测TEST CONNECTION时报Access denied for user 'hive'@'xxxxx' (using password: YES)错误,一直连接不上
2021-02-05 22:35:36,606 - Check db_connection_check was unsuccessful. Exit code: 1. Message: Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
ERROR: Unable to connect to the DB. Please check DB connection properties.
java.sql.SQLException: Access denied for user 'hive'@'VM-16-6-centos' (using password: YES)
Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/custom_actions/scripts/check_host.py", line 546, in <module>
CheckHost().execute()
File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute
method(env)
File "/var/lib/ambari-agent/cache/custom_actions/scripts/check_host.py", line 207, in actionexecute
raise Fail(error_message)
resource_management.core.exceptions.Fail: Check db_connection_check was unsuccessful. Exit code: 1. Message: Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
ERROR: Unable to connect to the DB. Please check DB connection properties.
java.sql.SQLException: Access denied for user 'hive'@'VM-16-6-centos' (using password: YES)
- 解决方法:
从Access denied for user 'hive'@'VM-16-6-centos' (using password: YES)
来看,是mysql没有获取授权导致,通过以下操作即可解决:
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'VM-16-6-centos' IDENTIFIED BY '密码' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'VM-16-6-centos' IDENTIFIED BY '密码' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'VM-16-6-centos' IDENTIFIED BY '密码' WITH GRANT OPTION;
-----------------------------------------------------------
shotting source code
shotting source code