Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flush tables - access denied

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
like image 904
clarkk Avatar asked Apr 02 '12 07:04

clarkk


2 Answers

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.

like image 103
codewaggle Avatar answered Nov 15 '22 21:11

codewaggle


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';
like image 20
Marco Avatar answered Nov 15 '22 20:11

Marco