Is it possible in MySQL to set permissions for a user in such a way that he could not perform queries on insert, update, delete, but could call stored procedures that perform such queries. If so, how?
1 answer
Request syntax for revoking user privileges:
REVOKE privilege ON object FROM username where privilege is a type of privilege (in your case - INSERT, UPDATE, DELETE).
If you suddenly want to set the privilege back:
GRANT privilege ON object TO username You can FLUSH PRIVILEGES privileges using FLUSH PRIVILEGES
When creating a procedure, you must specify the rights with which it will be performed:
- INVOKER - the script is executed with the rights of the user who called it,
- DEFINER - the script is executed with the rights of the user specified in CREATE DEFINER.
|
SQL SECURITY DEFINER. - Akina