Support Questions
Find answers, ask questions, and share your expertise

cann't start hive metastore by command line

Explorer

when i start hive by

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.1/bk_reference/content/starting_hdp_services....

using:

su hive
nohup /usr/hdp/current/hive-metastore/bin/hive --service metastore>/var/log/hive/hive.out 2>/var/log/hive/hive.log

i got errorlog from /var/log/hive/hive.log

java.sql.SQLExcption: Access denied for user 'hive'@'localhost' (using password: YES). SQL Error code: 1045"

i am quite sure that i can access mysql by typing:

mysql -u hive -h localhost -ppasswd

and the user 'hive' have all privileges

please help me,thanks!

6 REPLIES 6

Super Mentor

@white wartih

As you mentioned that the 'hive' user has all the privileges, Bit the following error still indicates that the permissions/privileges might not be accurately set.

Can you please check the following table:

mysql> use mysql;
mysql> select user,host from user;
+------+-----------------------+
| user | host                  |
+------+-----------------------+
| hive | %                     |
| hive | 127.0.0.1             |
| root | 127.0.0.1             |
| hive | ::1                   |
| root | ::1                   |
| hive | localhost             |
| root | localhost             |
| hive | node1.hortonworks.com |
| root | node1.hortonworks.com |
| hive | node2.hortonworks.com |
| hive | node3.hortonworks.com |
+------+-----------------------+

.

Also checking the following might be good as described in : https://community.hortonworks.com/articles/65261/getting-past-access-denied-for-user-error-during-h....

mysql> grant all on *.* to 'hive'@'localhost' identified by'changeme';

.

Also it will be good to check if the correct mysql is being used by metastore (like the local mysql or is it configured to use remote mysql)

Explorer
@Jay SenSharma

thanks,but this doesn't work,i even create an account 'hive'@'localhost' which is not created by default,it still can't access.

Explorer

by the way, i can start hive successfully by WEB UI

Explorer

i think it can't get the proper passwd by command line

Mentor

@white wartih

Try adding the admin privileges

GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'localhost' IDENTIFIED BY 'hive_password' WITH GRANT OPTION;

Hope it works

Explorer
@Geoffrey Shelton Okot

thank you.. but doesn't work...