GICT knowledge base
cPanel Database Root Passwords and Grant Recovery: Different Tasks
Published
Changing the database server’s root password and restoring an application’s database grants solve different problems. First identify whether the failure concerns administrative access, one database user’s credentials, missing grants or a cPanel database mapping.
Change a database root password through the supported WHM route
Only an authorized administrator should perform this operation. Use the current Database Services > Change Database Root Password interface, historically called MySQL Root Password under SQL Services. Confirm whether the active profile refers to a local or remote database server.
Protect recovery access and understand dependent services before changing the password. Follow the installed panel’s password requirements and secure storage. Do not edit cPanel-managed root credential files or use a generic skip-grant-tables recipe as a routine reset.
For remote profiles, coordinate the database server and hosting-server profile updates using the vendor’s documented workflow. A change on one side alone can leave the panel unable to administer databases. This guide does not perform or authorize any password reset.
Restore one user’s grants when that is the actual problem
cPanel’s restoregrants utility can recover saved grant information for a specified owned database user. Confirm the real cPanel username and database username, take appropriate state backups and inspect the account mapping first. This is a root-administrator command, not an ordinary shared-hosting user action.
cpuser='account_name'
dbuser='account_dbuser'
/usr/local/cpanel/bin/restoregrants \
--cpuser="$cpuser" --db=mysql --dbuser="$dbuser"
Replace the example names before an authorized administrator runs it. Use exactly one database type; {mysql, pg} in vendor reference notation is not a literal command argument to paste into a shell. The --all option affects all owned database users and should not be selected without that intended scope.
Grant recovery does not restore missing tables or prove that an application password is correct. If the saved grants or mapping are wrong, investigate with the provider rather than escalating to broad privileges or account-password resets without a recovery plan.
Verify the intended access
Test the application’s database connection, intended permissions and affected panel functions. Inspect errors, confirm unrelated accounts still work and retain rollback information. Never put root credentials, private option-file contents or unrestricted grant dumps in public comments.
References: Change Database Root Password and How to Restore Database Grants. Reviewed October 14, 2026. Syntax and documented scope were checked; no password or production grant change was executed.
Related guides
Host Additional Domains on an Eligible InterServer Account
Check your hosting limits, choose a separate site or alias and use cPanel or DirectAdmin with deliberate DNS, content and certificate verification.
cPanelHardening Your cPanel Server: Beyond the Basics After CVE-2026-41940
Security is a moving target. With the recent discovery of CVE-2026-41940, it has become clear that just having a firewall isn't enough anymore.
cPanelcPanel and Plesk notice: Awstats,. Webalizer and Analog stats are being removed
Important Update: cPanel and Plesk Phasing Out Legacy Statistics Tools If you regularly check your website traffic through your hosting control panel, we have an...
cPanelThe dangers of shared licenses (in other words unofficial/cracked licenses)
Why Cracked cPanel Licenses Aren’t Worth the Risk: A Guide for InterServer Customers When you’re managing a server, every dollar counts.
