mysql授權使用者許可權 mysql授權使用者許可權

2021-10-17 13:01:07 字數 2326 閱讀 8515

grant 普通資料使用者,查詢、插入、更新、刪除 資料庫中所有表資料的權利。

grant select on testdb.* to common_user@』%』

grant insert on testdb.* to common_user@』%』

grant update on testdb.* to common_user@』%』

grant delete on testdb.* to common_user@』%』

或者,用一條 mysql 命令來替代:

grant select, insert, update, delete on testdb.* to common_user@』%』

9>.grant 資料庫開發人員,建立表、索引、檢視、儲存過程、函式。。。等許可權。

grant 建立、修改、刪除 mysql 資料表結構許可權。

grant create on testdb.* to developer@』192.168.0.%』;

grant alter on testdb.* to developer@』192.168.0.%』;

grant drop on testdb.* to developer@』192.168.0.%』;

grant 操作 mysql 外來鍵許可權。

grant references on testdb.* to developer@』192.168.0.%』;

grant 操作 mysql 臨時表許可權。

grant create temporary tables on testdb.* to developer@』192.168.0.%』;

grant 操作 mysql 索引許可權。

grant index on testdb.* to developer@』192.168.0.%』;

grant 操作 mysql 檢視、檢視檢視源** 許可權。

grant create view on testdb.* to developer@』192.168.0.%』;

grant show view on testdb.* to developer@』192.168.0.%』;

grant 操作 mysql 儲存過程、函式 許可權。

grant create routine on testdb.* to developer@』192.168.0.%』; -- now, can show procedure status

grant alter routine on testdb.* to developer@』192.168.0.%』; -- now, you can drop a procedure

grant execute on testdb.* to developer@』192.168.0.%』;

10>.grant 普通 dba 管理某個 mysql 資料庫的許可權。

grant all privileges on testdb to dba@』localhost』

其中,關鍵字 「privileges」 可以省略。

11>.grant 高階 dba 管理 mysql 中所有資料庫的許可權。

grant all on *.* to dba@』localhost』

12>.mysql grant 許可權,分別可以作用在多個層次上。

1. grant 作用在整個 mysql 伺服器上:

grant select on *.* to dba@localhost; -- dba 可以查詢 mysql 中所有資料庫中的表。

grant all on *.* to dba@localhost; -- dba 可以管理 mysql 中的所有資料庫

2. grant 作用在單個資料庫上:

grant select on testdb.* to dba@localhost; -- dba 可以查詢 testdb 中的表。

3. grant 作用在單個資料表上:

grant select, insert, update, delete on testdb.orders to dba@localhost;

4. grant 作用在表中的列上:

grant select(id, se, rank) on testdb.apache_log to dba@localhost;

5. grant 作用在儲存過程、函式上:

grant execute on procedure testdb.pr_add to 』dba』@』localhost』

grant execute on function testdb.fn_add to 』dba』@』localhost』

注意:修改完許可權以後 一定要重新整理服務,或者重啟服務,重新整理服務用:flush privileges。

mysql使用者授權 mysql使用者許可權管理

查詢資料庫使用者 select user 使用ip鏈結資料庫 匹配所有 mysql h192.168.1.ulisi p x 修改host域,使ip可以鏈結上 update user set host 192.168.1.where user root flush privileges 修改使用者密...

python許可權授權 MySQL授權(使用者許可權)

一 mysql查詢與許可權 二 授權 使用者管理 設定使用者密碼 前期準備工作 停止服務 將配置檔案當中的skip grant tables刪除掉 重啟服務 執行修改命令 檢視使用者狀態 如果資料過多,用 g可以規範布局 select user,host,authentication string ...

mysql 授權 mysql 使用者授權

mysql grant 許可權1,許可權2,許可權n on 資料庫名稱.表名稱 to 使用者名稱 使用者位址 identified by 連線口令 許可權1,許可權2,許可權n代表select,insert,update,delete,create,drop,index,alter,grant,re...