iT邦幫忙

1

[MySQL] 資料表權限 移除 問題

我的 MySQL 資料庫版本是 5.6.35,使用 InnoDB。

我想對 db1資料庫 裡的 T1這一張資料表,移除 U1 這一位使用者的 Delete 和 Drop Table 權限,操作指令如下 :

Revoke delete,drop on db1.T1 from U1;

執行後沒有出現錯誤訊息。

但是執行之後,U1 這一位使用者還是可以使用 DELETE 指令 刪除 T1這一張資料表裡的資料列。
也是可以使用 DROP TABLE 指令 將 T1 這一張資料表刪除。

感謝回覆。

ckp6250 iT邦好手 1 級 ‧ 2021-06-12 04:31:15 檢舉
from u1@xxxxx
一般是使用flush privileges; 讓權限生效.
https://dev.mysql.com/doc/refman/5.7/en/privilege-changes.html
裡面有提到
If you modify the grant tables directly using statements such as INSERT, UPDATE, or DELETE (which is not recommended), the changes have no effect on privilege checking until you either tell the server to reload the tables or restart it. Thus, if you change the grant tables directly but forget to reload them, the changes have no effect until you restart the server. This may leave you wondering why your changes seem to make no difference!
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答