1. 程式人生 > 其它 >hive啟動metastore報錯

hive啟動metastore報錯

技術標籤:bug解決mysqlhadoop大資料

hive啟動metastore報錯:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ‘root’@‘node03’ to database ‘hive’

錯誤原因如下:

image-20210204164728658

解決步驟:

  • 首先進入msql命令列

    • msql -uroot -p*********
  • 執行如下操作:

    ​ 注意這句要根據自己的資料庫名活用:grant all on 資料庫.* to ‘使用者名稱’@’%’ identified by ‘密碼’ with grant option;

    
    mysql> grant all privileges on *hive* to 'root'@'%' identified by '123456' with grant option;
    ERROR 1046 (3D000): No database selected
    mysql> grant all privileges on hive.* to 'root'@'%' identified by '123456' with grant option;
    ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
    mysql>
    set global validate_password_policy=LOW; Query OK, 0 rows affected (0.00 sec) mysql> set global validate_password_length=6; Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on hive.* to 'root'@'%' identified by '123456' with grant option; Query OK, 0 rows affected, 1 warning (0.00 sec)
    mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit
    • 然後重啟mysql

      sudo service mysqld restart
      
  • 開啟metastore即可正常啟動了

bin/hive --service metastore &