MySQL 刷新表 - 访问被拒绝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9972651/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 12:48:20  来源:igfitidea点击:

flush tables - access denied

mysqlmysqldump

提问by clarkk

I need to back my database, but when trying to flush the tables before backing up I get this error? What does it mean by RELOADprivilege?

我需要备份我的数据库,但是在备份之前尝试刷新表时出现此错误?RELOAD特权是什么意思?

Can't find any RELOAD privilege in phpmyadmin!?

在 phpmyadmin 中找不到任何 RELOAD 权限!?

Error: Access denied; you need the RELOAD privilege for this operation
SQL: FLUSH TABLES WITH READ LOCK

采纳答案by Marco

Probably you're not running FLUSHcommand using root, but with a limited user.
You need to be granted RELOADprivilege to run FLUSHcommand.
Take a look herefor MySQL privileges.
So (for example) root user should use:

可能您没有FLUSH使用 root运行命令,而是使用有限的用户。
您需要被授予RELOAD运行FLUSH命令的权限。
看看这里为MySQL权限。
所以(例如)root 用户应该使用:

GRANT RELOAD ON *.* TO 'your_user'@'localhost';

回答by codewaggle

To clarify:
RELOAD can only be granted globally, not to a particular database. Need to use *.*

澄清
一下:RELOAD 只能授予全局权限,不能授予特定数据库。需要使用*.*

GRANT RELOAD ON *.* TO 'your_user'@'localhost';

From the MySQL docs: GRANT Syntax - Global Privileges

来自 MySQL 文档:GRANT Syntax - Global Privileges

The CREATE USER, FILE, PROCESS, RELOAD, REPLICATION CLIENT, REPLICATION SLAVE, SHOW DATABASES, SHUTDOWN, and SUPER privileges are administrative and can only be granted globally.

CREATE USER、FILE、PROCESS、RELOAD、REPLICATION CLIENT、REPLICATION SLAVE、SHOW DATABASES、SHUTDOWN 和 SUPER 权限是管理权限,只能全局授予。