sakhunzai
sakhunzai

Reputation: 14470

What are the minimum privileges required for using mysqldump

I want to create mysql user with limited privileges to use only with mysqldump. What are minimum privileges that we can assign to user so he can just take dump and load databases or this requires admin rights ?

For now I have something like this working but I am not certain about the scope:

 DROP user 'dumpuser'@'localhost' ;
 FLUSH PRIVILEGES ;
 GRANT  SELECT ON mysql.proc TO  'dumpuser'@'localhost' IDENTIFIED BY 'dumppwd';
 GRANT  ALL ON dbname.* TO 'dumpuser'@'localhost' IDENTIFIED BY 'dumppwd';
 FLUSH PRIVILEGES;

I want to further limit privilege scope if possible.

Upvotes: 4

Views: 3917

Answers (1)

exussum
exussum

Reputation: 18550

mysqldump requires at least the SELECT privilege for dumped tables, SHOW VIEW for dumped views, TRIGGER for dumped triggers, and LOCK TABLES if the --single-transaction option is not used. Certain options might require other privileges as noted in the option descriptions.

From http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

Upvotes: 6

Related Questions