问题
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