Symptoms
Trying to run mysqldump as a MySQL virtual user(i.e. WordPress db user) will result in the error:
[user@server ~]# mysqldump -u cptest_wp -p cptest_wp > testing.sql
Enter password:
mysqldump: Error: 'Access denied; you need (at least one of) the
PROCESS privilege(s) for this operation' when trying to dump tablespaces
Description
This error occurs when the database requires the "PROCESS" privilege and the user making the backup does not have that privilege. "PROCESS" is not a privilege grantable through the cPanel interface, and must be given through the command line. As such, users created entirely within the cPanel interface will not have this privilege.
This is related specifically to the update of mysql-community packages to version 5.7.31, often occurring during regular cPanel updates.
Workaround
You can add the "PROCESS" privilege to the user creating the database dump, which will grant it the appropriate privileges to perform the operation. The username and hostname variables must be updated before running the commands below.
Please note that this action must be done as root, and should be performed by a System Administrator to ensure the commands are run correctly:
mysql mysql -e "GRANT PROCESS ON . TO ${username}@'localhost'; flush privileges;"
mysql mysql -e "GRANT PROCESS ON . TO ${username}@'$(hostname)'; flush privileges;"