REVOKE command not recognised by phpMyAdmin

半世苍凉 提交于 2020-12-15 06:48:18

问题


I am attempting to create a new user for my database with read permissions and then remove the users DROP permission.

I have tried the code seen below, however, it does not seem to work. A red squiggly line is placed under the command REVOKE, with the error message :

Unrecognised statement type. (near REVOKE)

I don't have a clue what's wrong?

CREATE USER Dave@'localhost'  IDENTIFIED BY 'password' ;
GRANT ALL PRIVILEGES ON DB.* TO 'Dave'@'localhost';
REVOKE DROP ON DB.* TO 'Dave'@'localhost';
FLUSH PRIVILEGES;

回答1:


You REWORK synatax is wrong.

As par the mysql docs on REVOKE :

REVOKE
    priv_type [(column_list)]
      [, priv_type [(column_list)]] ...
    ON [object_type] priv_level
    FROM user_or_role [, user_or_role] ...

So you want :

REVOKE DROP ON DB.* FROM Dave'@'localhost';


来源:https://stackoverflow.com/questions/53898540/revoke-command-not-recognised-by-phpmyadmin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!