How to Rename a MySQL Database in cPanel
cPanel makes renaming a MySQL database refreshingly simple — there is a built-in Rename option, so you do not have to export and re-import anything. The one thing to remember is to update your site's config afterwards, since it references the database by name.
Before you begin
Renaming changes what your website looks for, so take a quick backup first. It is a safe operation, but a backup is cheap insurance.
Step 1: Rename the database
- Log in to cPanel and open MySQL Databases.
- Under Current Databases, find the one you want to rename.
- Click Rename beside it, enter the new name, and confirm.
cPanel handles the rename and keeps the data and user privileges intact.
Step 2: Update your site's config
Your website connects using the database name, so update it:
- WordPress — change
DB_NAMEinwp-config.php. - Other apps — update the database name in their config file.
Edit the file in File Manager and save.
Step 3: Test
Reload your site. If it loads, the new name is connected correctly. A connection error means the config still points to the old name.
Frequently asked questions
Will renaming lose my data?
No. The rename keeps all tables and data; only the database's name changes. Still, take a backup first as a matter of habit.
Do the database users carry over?
Yes, cPanel preserves the user assignments and privileges through the rename. You only need to update the database name in your site config, not the user.
My host doesn't show a Rename button.
If the option is unavailable, you can achieve the same result by creating a new database, then exporting and importing the data into it.
Was this article helpful?