How to Rename or Change WordPress Database Name

Generally, when you are installing WordPress manually, you also need to create a new database to work with the WordPress. While creating the database, you can name it whatever you want, probably.

But if you are using automated installation scripts like Fantastico,¬†Softaculous, etc.., then the scripts may sometimes randomly name your WordPress database. The automatic naming of the database may not be descriptive but is pretty good as you don’t have to mess with it.

As useful as it is, if you have multiple databases, then you need to have a good descriptive database name in order to differentiate between them.

So, if you ever need, here is how you can easily rename or change WordPress database name in simple steps.

Rename or Change WordPress Database Name

Since we are going to make the modifications to the actual database, make sure that you have a good and complete backup of your WordPress database. Just in case.

1. Renaming or changing the WordPress database name is pretty easy and fast. To start off, open your cPanel, find and click on the link “phpMyAdmin” under the Databases section.

Quick tip: You can use the search feature in the cPanel to quickly find the option or module you need.

change-wp-database-name-phpmyadmin

2. Once the phpMyAdmin panel has been opened, select the tab “Databases” and then again select the database you want to change the database name. For instance, I’m selecting the database “dev” as I want to change the name of it.

change-wp-database-name-select-database

3. The above action will open the selected database and shows you all the tables. Here, click on the tab “Operations” appearing on the top navigation bar.

change-wp-database-name-select-operations

4. Once the operations panel has been open, enter your new database name in the blank field under the “Rename Database to” section and click on the button “Go” to complete the process.

change-wp-database-name-add-new-database-name

In my case, I’ve entered my new database name as “dev_blogger.”

Configure wp-config.php File

After changing the database name in phpMyAdmin, you need to reflect the changes in your wp-config.php file.

5. So, open the file using any of your favorite FTP clients and replace the old database name with the new one. Once replaced, it will look something like this.

change-wp-database-name-new-database-name-wp-config-file

Once you are done with the changes, save and reupload the file.

Assign User to Database

6. The last thing you need to do after changing the database name is to add a user to the modified database. To do that select “MySQL Databases” under the Database section in your cPanel.

change-wp-database-name-mysql-databases

7. Now, under the “Add a User to a Database” section, select your username from the drop-down menu and then select the database you want to assign from the drop-down menu and click on the “Add” button.

8. The above action will add the user and reloads the page. Here select the checkbox “All Privileges” and click on the “Make Changes” button to save the changes.

change-wp-database-name-all-previliges

That’s all there is to do and it is that simple to rename or change WordPress database name. Also, don’t forget that the default WordPress table prefix is sometimes prone to hack attacks. So, learn how to change WordPress table prefix as a WordPress security measure.

Hopefully that helps and do comment below sharing your thoughts and experiences about changing the WordPress database name.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.