天天看點

grant all privileges on *.* to 報錯問題

mysql8.0無法給使用者授權或提示you are not allowed to create a user with grant、for the right syntax to use near 'identified by xxx'的問題

提示意思是不能用grant建立使用者,mysql8.0以前的版本可以使用grant在授權的時候隐式的建立使用者,8.0以後已經不支援,是以必須先建立使用者,然後再授權,指令如下:

mysql> create user 'root'@'%' identified by 'hadoop3!';

query ok, 0 rows affected (0.04 sec)

mysql> grant all privileges on . to 'root'@'%';

query ok, 0 rows affected (0.03 sec)

另外,如果遠端連接配接的時候報plugin caching_sha2_password could not be loaded這個錯誤,可以嘗試修改密碼加密插件:

mysql> alter user 'root'@'%' identified with mysql_native_password by 'hadoop3!';

轉自:https://www.cnblogs.com/cqdxwjd/p/9925051.html

繼續閱讀