1. 今天剛裝了mysql8.0.13,試着分配幾個賬號和權限,結果報錯:

2. 查資料得知mysql8的分配權限不能帶密碼隱士創建賬號了,要先創建賬號再設置權限

輸入命令:

Grant all privileges on test.* to 'test'@'%';

又報錯:

You are not allowed to create a user with GRANT;

不允許使用grant命令,怎么會沒權限,奇怪。

3.后來想到了mysql數據表user中的host

於是修改host:

update user set host='%' where user='test';

再執行兩次

Grant all privileges on test.* to 'test'@'%';

成功:

但連接Navicat報錯

這是因為mysql8的加密方式和Navicat不一樣

4.修改加密方式:

alter user test identified with mysql_native_password by 'xxx';

再試,搞定! 

原文鏈接:https://blog.csdn.net/qq_34680444/article/details/86238516