O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Revoking grants

Revoking grants has the same syntax as creating grants. You grant a privilege TO the user and revoke a privilege FROM the user.

  • Revoke the DELETE access from the 'company_write'@'%' user:
mysql> REVOKE DELETE ON company.* FROM 'company_write'@'%';Query OK, 0 rows affected (0.04 sec)
  • Revoke the access to the salary column from the employee_ro user:
mysql> REVOKE SELECT(salary) ON employees.salaries FROM 'employees_ro'@'%';Query OK, 0 rows affected (0.03 sec)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required