What are the minimum privileges required for using mysqldump

岁酱吖の 提交于 2020-03-22 04:43:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!