When running mysqldump on a shared hosting environment or as a database user with limited privileges, you may encounter this error:
Problem: Running mysqldump to back up a WordPress database fails with: "Error: 'Access denied; you need the PROCESS privilege for this operation'" — even when using the database user that works in phpMyAdmin.
Solution: Add the --no-tablespaces flag to the mysqldump command — it skips the InnoDB tablespace metadata dump that requires the PROCESS privilege, which is commonly restricted on managed and shared hosting environments.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s)
for this operation' when trying to dump tablespaces.
As the error message itself hints, mysqldump attempts to dump InnoDB tablespace information by default and requires the PROCESS privilege to do so. On shared hosting this privilege is almost never granted to regular database users.
Fix: add the --no-tablespaces flag. This tells mysqldump to skip the tablespace dump entirely, which is safe for WordPress backups — the tablespace metadata is not needed to restore the database on a different server:
mysqldump --no-tablespaces -h localhost -u database_user -p database_name > /path/to/backup/database.sql
You will be prompted for the password after running the command.
For a complete, single-command dump with common production-ready options:
mysqldump --no-tablespaces --single-transaction --skip-lock-tables --add-drop-table -h localhost -u database_user -p database_name | gzip > /path/to/backup/database_$(date +%F).sql.gz
— --single-transaction: creates a consistent snapshot without locking tables (InnoDB only).
— --skip-lock-tables: avoids locking all tables for a read, which would block active users.
— The pipe through gzip compresses the output on the fly, which can reduce file size by 70–90% for a typical WordPress database.
NOTE: The --no-tablespaces option was introduced in MySQL 5.7.31 and MySQL 8.0.21. If your server runs an older MySQL version you will need to either request the PROCESS privilege from the hosting provider or use a tool like phpMyAdmin's export feature, which does not require it.