25

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 RELOAD privilege?

Can't find any RELOAD privilege in phpmyadmin!?

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

2 Answers 2

27

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

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

From the MySQL docs: 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.

0
18

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

GRANT RELOAD ON *.* TO 'your_user'@'localhost';
5
  • 1
    it means I can do this instead? # mysqladmin flush-tables ?
    – clarkk
    Apr 2, 2012 at 8:00
  • @clarkk: if you have RELOAD privilege, you can run mysqladmin commands that use FLUSH... But you have to wait to be granted RELOAD privilege...
    – Marco
    Apr 2, 2012 at 8:02
  • where do I put password in your query?
    – clarkk
    Apr 2, 2012 at 8:08
  • I assume GRANT RELOAD ON ... has to be done from the root user in mysql?
    – clarkk
    Apr 2, 2012 at 8:09
  • For me, this query resulted in: ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES. Answer from @codewaggle worked, though.
    – Max
    Apr 17, 2014 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.