mysql8建立使用者

2022-09-21 05:21:11 字數 549 閱讀 1707

create

user test_user@'

%' identified by

'test2022@';

grant

allprivileges

on test.*

to test_user@'%'

with

grant

option

;flush

privileges;

這樣就可以建立乙個叫 test_user 的使用者並把密碼設定為 test2022@.

同時授予 它 test 資料庫的所有表許可權

重新整理許可權規則

如果你要修改遠端連線使用者的加密規則 可以用這個

alter

user test_user@'

%' identified with mysql_native_password by

'你的密碼

';

flush privileges;

如果兩次密碼不一致,後面的會覆蓋前面的

mysql8建立不了使用者 mysql8建立使用者

假如是mysql8版本的話,使用 grant all privileges to 使用者 localhost identified by 自定義密碼 會報錯,因為要先建立使用者再進行賦權,不能同時進行 建立使用者 create user 使用者名稱 localhost identified by 密...

MySQL8使用者管理

mysql create user user1 localhost identified by 123456 identified by 後面是密碼,直接寫就可,不需再加password 函式。使用剛剛建立的使用者登入,然後執行show databases會發現只有乙個名為information s...

mysql8 建立使用者賬號以及賦予使用者許可權

建立使用者並設定密碼 123456 是密碼 create user test localhost identified by 123456 create user test identified by 123456 其中localhost指本地才可連線 可以將其換成 指任意ip都能連線 也可以指定i...