Restoring a User's Database Access
For WHM version 11.38
If a database user loses access to databases, you may be able to restore the user's grants to the database using the
restoregrants utility.
Using Restoregrants to Restore the User's Database Access
Execute one of the following commands from the command line:
/usr/local/cpanel/bin/restoregrants --cpuser=$cpuser --db={mysql, pg} --dbuser=$dbuser
or
/usr/local/cpanel/bin/restoregrants --cpuser=$cpuser --db={mysql, pg} --all
In the example above:
| This variable: |
Stands for: |
$cpuser |
The cPanel username which has lost access to databases. |
{mysql, pg} |
The type of database: mysql for MySQL or pg for PostgreSQL. |
$dbuser |
The database user whose privileges you wish to restore. If you use --dbuser, the $dbuser variable will consist of the database user's name. If you use --all, the script will restore grants for all of the database users that belong to the cPanel account. |
How to Update the cPanel User's Password to Restore Database Access
In certain circumstances, the
restoregrants script may fail to restore access to the database.
If this occurs, either the cPanel user or the WHM user who owns the account (that is, the
reseller or system administrator) can restore grants by resetting the cPanel account's password.
The cPanel user can:
- Navigate to cPanel > Change Password.
- Select Allow MySQL password change.
- Change the password and click Change your password now.
The server administrator or
reseller can:
- Navigate to WHM > List Accounts.
- Click + next to the appropriate account.
- Select Sync MySQL password with account password.
- Enter a new password into the Change Password box and click Change.
Topic revision: r9 - 25 Jan 2013 - 16:28:03 - Main.LaurenceSimon
AllDocumentation/WHMDocs.RestoringDatabaseAccess moved from Sandbox.RestoringDatabaseAccess on 27 Apr 2011 - 19:14 by Main.JustinSchaefer -
put it back