问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/24307471/what-are-the-minimum-privileges-required-for-using-mysqldump