1

Is it possible to give a user privilege to view Triggers, i.e. execute the SHOW TRIGGERS command, without also giving them permission to DROP TRIGGER?

Background is, I want to give certain users the ability to make a complete dump/backup/copy of our production database (including triggers), but I want to keep the number of accounts that can actually change the production database as small as possible.

1 Answer 1

0

Is it possible to give a user privilege to view Triggers, i.e. execute the SHOW TRIGGERS command, without also giving them permission to DROP TRIGGER?

No. In a few words show triggers and drop trigger requires the same trigger privilege.

  • SHOW TRIGGERS statement returns results only for databases and tables for which you have the TRIGGER privilege.
  • DROP TRIGGER requires the TRIGGER privilege for the table associated with the trigger.

TRIGGER privilege

Enables trigger operations. You must have this privilege for a table to create, drop, execute, or display triggers for that table.

When a trigger is activated (by a user who has privileges to execute INSERT, UPDATE, or DELETE statements for the table associated with the trigger), trigger execution requires that the user who defined the trigger still have the TRIGGER privilege for the table.

2
  • Thats what I feared. Thanks for confirming it. Seems like we have to live with the fact that people either can change production triggers or can't view them. Sep 21 at 9:46
  • @BrokenPhysics in fact this should be a feature. Maybe this would exists in the future versions of MySQL Sep 21 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.