mysql 給使用者賦權和刪除許可權

2021-08-21 13:51:19 字數 461 閱讀 6767

mysql通過 grant 授予許可權 , revoke 撤銷許可權

授予使用者許可權:

grant all privileges on 層級 to 使用者名稱@主機  identified by  '密碼';

授予wang使用者全域性級全部許可權:

grant all privileges on *.* to 'wang'@'%' identified by 'wang';

授予wang使用者針對xsgl資料庫全部許可權:

grant all privileges on xsgl.* to 'wang'@'%' identified by 'wang';

刪除乙個使用者許可權:(小寫)

revoke all privileges from 使用者名稱;

舉例:撤銷wang使用者的全部許可權:

revoke all privileges from wang;

mysql給使用者賦許可權

mysql grant 許可權1,許可權2,許可權n on 資料庫名稱.表名稱 to 使用者名稱 使用者位址 identified by 連線口令 例子 grant all privileges on to root localhost identified by root 許可權1,許可權2,許可...

mysql建立使用者刪除許可權 使用者建立 許可權 刪除

使用者建立 許可權 刪除操作 連線mysql操作 mysql h 主機位址 u 使用者名稱 p 使用者密碼 注 u與root可以不用加空格,其它引數也一樣。demo 開啟電腦cmd,輸入 mysql h 127.0.0.1 u root p 回車,然後輸入密碼。就可以連線到本地的mysql資料庫。建...

mysql使用者賦權

建立使用者 create user test localhost identified by test 解釋 建立test使用者,密碼是test,允許在mysql伺服器登入,如果允許其他伺服器連線,localhost改為 賦予使用者許可權 方法1 grant all on to test local...