Mysql – What permissions do you need to take a thesql database backup via SSH

backupMySQL

are 'SELECT' and 'LOCK' privileges enough for a 'mysql database user' to take a full database backup via SSH? I am able to take a backup using these privileges, but unsure if I am backing up all the files properly. So my question is, are these two privileges enough or does the user need more privileges in order to take a proper backup?

Best Answer

Depending on the options you use with the dump you may need more (or less). The one you definitely need is SELECT.

  • If you use triggers you need TRIGGER
  • If you use views you need SHOW VIEW
  • If you don't use --single-transaction in the dump you will need LOCK TABLES

For more info on the subject you can go to: http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html