Come impostare i privilegi utente MySQL per il backup e il ripristino

Questo articolo è per Zmanda Recovery Manager per MySQL (ZRM)

Nell'esempio seguente mostriamo i passaggi per concedere a un utente del database MySQL i privilegi richiesti per eseguire backup e ripristini per tutte le tabelle in tutti i database di un server MySQL. Se l'utente specificato non esiste già, verrà creato. Allo stesso modo, è possibile utilizzare due diversi utenti del database: uno per i backup e uno per i ripristini. Perfavore guarda Privilegi richiesti per l'account MySQL nel Manuale utente di ZRM per MySQL per maggiori dettagli e l'elenco più aggiornato dei privilegi richiesti ciascuno per backup e ripristini.

Ambiente di esempio

Nome utente di backup:utente di backup
Password utente di backup:zrmbackup
Host del server di backup ZRM:quarzo.zmanda.com
Host del server MySQL:db2.zmanda.com
Versione del server MySQL5.1.x

Passi

  1. Accedi al server MySQL.
  2. Connettiti a MySQL come utente root.db2:/ # mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 1 to server version: 5.1.08
    Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
    mysql>
  3. Concedi i privilegi per l'utente backup-user per connettersi dal server ZRM quartz.zmanda.com con password zrmbackup.Nota: localhost può essere utilizzato al posto di quartz.zmanda.com quando il server MySQL è locale sul server ZRM.mysql> GRANT SELECT, INSERT, UPDATE, CREATE, DROP, RELOAD, SHUTDOWN, FILE, INDEX, ALTER, SUPER, LOCK TABLES, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, TRIGGER, CREATE ROUTINE, DELETE, EVENT, ALTER ROUTINE ON *.* TO 'backup-user'@'quartz.zmanda.com' IDENTIFIED BY 'zrmbackup';
    Query OK, 0 rows affected (0.01 sec)
  4. Privilegi a filo.mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec) using password