Alireza Alireza - 1 year ago 78
MySQL Question

REVOKE insert on a specific table form a user in my sql

i want to revoke insert on a specific table form a user in mysql
and I try this code before:

use varian_db;
REVOKE INSERT ON 'gevhm_users' FROM 'varian_user';

but mysql returned this error :

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''gevhm_users' FROM 'varian_user'' at line 1

Please help.

Answer Source

You have to specify full path of database name and table name when granting or revoking privileges to/from such user. And also write user name in correct format. Your statement should like this:

REVOKE INSERT ON varian_db.gevhm_users FROM 'varian_user'@'user_ip_address';

More information: MySQL Revoke Syntax

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download