dannyman.toldme.com

About Me : Free Style : Good Reads : News and Reaction : Photographs : Technical : Travels : Unsorted

Search:
August 22, 2006
Technical

MySQL: Backup User Privileges

Q: What privileges must I grant to a MySQL user to allow them to run mysqldump?

A: LOCK TABLES, SELECT seems to do the trick.

Example: GRANT LOCK TABLES, SELECT ON mydatabase.* TO 'backup'@'backuphost' IDENTIFIED BY 'somecoolpassword';

Principle of least-privilege: don’t entrust your backup host with the power to hurt the database if you don’t have to. SELECT allows the user to read data, and LOCK TABLES allows the user to lock the tables while running a “snapshot” . . . and of course, narrow the privileges to a specific user-host-password tuple.

Read More

Next:
Previous:
Categories: Technical
Possibly-Related Posts
Notes on Porting a Django App from SQLite to MySQL
PostgreSQL Database Restored from Filesystem
HOWTO: Audit User Crontabs
MySQL Slave Database Can’t Catch Up
San Francisco Power Failure Killed Many Web Sites
MySQL Database Slave Did Catch Up!
Customer Service Rant

Responses

October 4th, 2007

MySQL: Backup User Privileges at they made me do it

[...] dannyman.toldme.com : MySQL: Backup User Privileges [...]

February 22nd, 2009

Bilgehan

What do we need in order to backup stored procedures also?

Comment

Leave a comment . . .

  1. You must provide an e-mail address.
  2. First-time comments will be held for review.
  3. Bogus e-mail addresses are lame, but will work.
  4. For private messages, e-mail me: dannyman@toldme.com.
  5. I will not spam you, and I will not publish or share your e-mail address.