Tuesday, July 17, 2007

Create a dedicated user for mysql backup script

Here is how you create a backup user that will be used in backup scripts :

[root@MyServer /]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 89061 to server version: 4.1.12

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> GRANT SELECT, SHOW DATABASES, LOCK TABLES ON *.* TO 'backup'@'localhost' IDENTIFIED BY 'MyPasswd';
Query OK, 0 rows affected (0.00 sec)


mysql> exit
Bye