使用mysqldump所需的最低权限是什么 [英] What are the minimum privileges required for using mysqldump
问题描述
我想创建具有有限权限的 mysql 用户,以便仅与 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.
推荐答案
mysqldump 至少需要转储表的 SELECT 权限,SHOW VIEW 用于转储视图,TRIGGER 用于转储触发器和 LOCK如果未使用 --single-transaction 选项,则为 TABLES.某些选项可能需要选项说明中所述的其他权限.
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.
来自 http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
这篇关于使用mysqldump所需的最低权限是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!