Minimum GRANTs needed by mysqldump for dumping a full schema? (TRIGGERs are missing!!) Minimum GRANTs needed by mysqldump for dumping a full schema? (TRIGGERs are missing!!) mysql mysql

Minimum GRANTs needed by mysqldump for dumping a full schema? (TRIGGERs are missing!!)


Assuming by full dump you also mean the VIEWs and the EVENTs, you would need:

GRANT USAGE ON *.* TO 'dump'@'%' IDENTIFIED BY ...;GRANT SELECT, LOCK TABLES ON `mysql`.* TO 'dump'@'%';GRANT SELECT, LOCK TABLES, SHOW VIEW, EVENT, TRIGGER ON `myschema`.* TO 'dump'@'%';

and if you have VIEWs that execute a function, then unfortunately you also need EXECUTE.

My own problem is: why do I need SELECT if I only want to make a no-data dump?


I found the extra GRANT I needed!!

  GRANT TRIGGER ON `myschema`.* TO 'dump'@'%'

Here you have the reference on the official doc: http://dev.mysql.com/doc/refman/5.5/en/privileges-provided.html#priv_trigger

The TRIGGER privilege enables trigger operations. You must have this privilege for a table to create, drop, or execute triggers for that table.


I found, that sometime if VIEW DEFINER user does not exist, dump fails.

Change it, as described there