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

cann't start hive metastore by command line


when i start hive by


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!


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 |             |
| root |             |
| hive | ::1                   |
| root | ::1                   |
| hive | localhost             |
| root | localhost             |
| hive | |
| root | |
| hive | |
| hive | |


Also checking the following might be good as described in :

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)

@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.


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


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


@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

@Geoffrey Shelton Okot

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