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
Check MariaDB Versions and Compatibility on Shared Hosting
Check your actual MariaDB/MySQL server version, maintenance coverage and application requirements before requesting a shared-hosting upgrade or move.
MySQLHow to Monitor MySQL Database Server Performance
Learn how to monitor MySQL performance with 4 essential Linux command-line tools.
MySQLHow to secure MySQL connections with SSL on Ubuntu
MySQL allows remote connections and we must protect data transfer happeneing between servers with SSL. Follow this tutorial to learn how.
MySQLHow to set up High Availability WordPress with HyperDB
HyperDB is a drop-in plugin that allows you to set up High Availability WordPress site that can work with multiple database servers at once.
