gpt4 book ai didi

mysql - 使用 mysqldump 所需的最低权限是什么

转载 作者:行者123 更新时间:2023-11-29 01:40:41 24 4
gpt4 key购买 nike

我想创建具有有限权限的 mysql 用户,仅用于 mysqldump。我们可以分配给用户的最低权限是什么,这样他就可以转储和加载数据库,或者这需要管理员权限?

现在我有类似的东西在工作,但我不确定范围:

 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;

如果可能,我想进一步限制特权范围。

最佳答案

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

关于mysql - 使用 mysqldump 所需的最低权限是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24307471/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com