mysqldump says access denied even though the user has ALL on the database
Access denied; you need (at least one of) the PROCESS privilege(s) for this operationShort answer
GRANT ALL ON db.* gives only database-level privileges. mysqldump may also need global ones: PROCESS to dump tablespaces, RELOAD for some options, and SHOW VIEW, TRIGGER or LOCK TABLES per database. Read which privilege the error names, then grant it or use --no-tablespaces or --single-transaction.
Fix it fast
1Find out which cause you have
List what the account really has, and read the privilege the error names. Compare it with what mysqldump needs: SELECT, SHOW VIEW, TRIGGER, LOCK TABLES, PROCESS.
SHOW GRANTS FOR 'backup'@'localhost';2Match what you see, then jump to its fix
- 1
Access denied; you need (at least one of) the PROCESS privilege(s) for this operationPROCESS is missing, and mysqldump dumps tablespaces by defaultFix - 2
Error 1044 or 1142 appears part-way through the dump, at a table, a view or a trigger.LOCK TABLES, SHOW VIEW or TRIGGER is not granted on that databaseFix - 3
The dump only fails when you add --flush-logs or --source-data, or the error names RELOAD.An option needs RELOAD or another global privilegeFix
- 1
What does the error look like?
Access denied; you need (at least one of) the PROCESS privilege(s) for this operationERROR 1044 (42000): Access denied for user 'backup'@'localhost' to database 'shop'
Cause 1 of 3
PROCESS is missing, and mysqldump dumps tablespaces by default
1Check
mysqldump needs PROCESS unless --no-tablespaces is used. PROCESS is a global (server administration) privilege, so GRANT ALL ON shop.* never includes it.
SHOW GRANTS FOR 'backup'@'localhost';2Fix
If you do not need tablespace information in the dump (most schemas do not), add --no-tablespaces. Otherwise grant PROCESS globally.
mysqldump --no-tablespaces -u backup -p shop > shop.sql
GRANT PROCESS ON *.* TO 'backup'@'localhost';3Verify
The dump finishes and the file contains the CREATE TABLE statements.
grep -c 'CREATE TABLE' shop.sqlConfirmed by dev.mysql.com
Cause 2 of 3
LOCK TABLES, SHOW VIEW or TRIGGER is not granted on that database
1Check
mysqldump needs SELECT for tables, SHOW VIEW for views, TRIGGER for triggers, and LOCK TABLES unless --single-transaction is used. A user created with only SELECT and INSERT lacks them.
SHOW GRANTS FOR 'backup'@'localhost';2Fix
Grant the missing database-level privileges, or use --single-transaction so LOCK TABLES is not needed.
GRANT SELECT, SHOW VIEW, TRIGGER, LOCK TABLES ON shop.* TO 'backup'@'localhost';
-- or, for InnoDB tables:
-- mysqldump --single-transaction --no-tablespaces -u backup -p shop > shop.sql3Verify
Run the dump again; no access error appears and the file is complete.
tail -n 3 shop.sqlConfirmed by dev.mysql.com
Cause 3 of 3
An option needs RELOAD or another global privilege
1Check
RELOAD is required for the --flush-logs and --source-data options. --source-data also needs the binary log enabled, and --tab needs the FILE privilege. GRANT ALL on a database never gives global privileges.
SHOW GRANTS FOR 'backup'@'localhost';2Fix
Grant the global privilege on *.*, or drop the option if you do not need it.
GRANT RELOAD ON *.* TO 'backup'@'localhost';3Verify
Repeat the dump with the same options.
tail -n 3 shop.sqlConfirmed by dev.mysql.com
How do I stop it coming back?
- Create a dedicated backup account with exactly the privileges mysqldump lists, instead of reusing an application user.
- Remember that GRANT ALL ON db.* is database-level only: it does not include global privileges such as PROCESS, RELOAD or FILE.
- Test the backup command as that account after every privilege change.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- ShopGoAn e-commerce aggregator with a Python scraping engine behind its catalog, past 10K Google Play downloads.
Related fixes
Databases
mysqldump says access denied (1045) with a password that works elsewhere
Access denied for user 'backup'@'localhost' (using password: NO)
Error 1045 means the server matched your connection to an account and rejected it.
3 causes, each with a fixDatabases
Installing the Airflow MySQL provider fails on pkg-config or mysqlclient
Building the mysqlclient wheel fails during the install
The Airflow MySQL provider depends on mysqlclient, which pip compiles against the MySQL C client library.
2 causes, each with a fixDatabases
A query on Aurora MySQL dies with 'table /rdsdbdata/tmp/#sql... is full'
ERROR 1114 (HY000): The table '/rdsdbdata/tmp/#sqlfd_1586_2' is full
In Aurora MySQL 3, internal temporary tables share one pool, and when that pool and the memory-mapped overflow file are used up, a reader instance ends the query with error 1114.
3 causes, each with a fixDatabases
Azure Database for MySQL refuses a connection that does not use SSL
ERROR 3159 (HY000): Connections using insecure transport are prohibited while --require_secure_transport=ON.
Azure Database for MySQL Flexible Server requires encrypted connections by default (require_secure_transport = ON, TLS 1.2).
4 causes, each with a fixDatabases
Compiling a C or C++ program that includes mysql.h fails
undefined reference to `mysql_init'
The compiler only finds mysql.h when the MySQL client development files are installed and their folder is on the include path.
3 causes, each with a fixDatabases
DBeaver fails to resolve Maven dependencies when downloading a database driver
A driver library does not download automatically
DBeaver downloads driver jars from a Maven repository.
3 causes, each with a fix