Create MySQL user to backup databases

It is recommend to create a backup user instead of using MySQL root user. If MySQL backup user and restore user are different, Please create a restore user. Restore user privileges are sightly higher than backup user.

Minimal Set

Minimal set of MySQL privileges that MySQL users should have to do backups and recovery are:

Backup

LOCK TABLES, SELECT, FILE, RELOAD, SUPER, SHOW VIEW

Restore

 CREATE, DROP, INDEX, SHUTDOWN, INSERT, ALTER, SUPER, REPLICATION CLIENT, CREATE, VIEW

Mysql Query

CREATE USER 'dbbackup'@'localhost' IDENTIFIED BY  '***';

GRANT SELECT , 
RELOAD , 
FILE , 
SUPER , 
LOCK TABLES , 
SHOW VIEW ON * . * TO  'dbbackup'@'localhost' IDENTIFIED BY  '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
comments powered by Disqus