Loading...

Knowledge Base
Save up to  70% off.  Start your website today!

How to Rename a Database in phpMyAdmin

The latest version of phpMyAdmin allows you to change the name of the database.

Remember that when you change the name of a database, you will have to reconfigure user permissions and any scripts that you want to continue referencing this database.

Before you begin:

For cPanel: If you want the same database user to have access to the renamed database, you should take note of the username already assigned to the database, which may or may not be similar to the current database's name.

  1. In cPanel, click on MySQL Databases.

    cPanel - MySQL Databases

  2. Scroll down to the Current Databases section of the page.

    phpMyAdmin - Current Databses

  3. Find the database you are about to rename, and take note or remember the database user already assigned to the database.  You will need to know this for Step 2.
  4. You can return to the cPanel home screen to begin Step 1.

Step 1: Renaming the Database

The phpMyAdmin may look slightly different in the video below; however, the steps described should remain the same.

  1. From cPanel, click on phpMyAdmin. (It should open in a new tab.)

    cPanel - phpMyAdmin

  2. Click on the database you wish to rename in the left-hand column.

    phpMyAdmin - Select Database

  3. Click on the Operations tab.

    phpMyAdmin - Operations tab

  4. Where it says "Rename database to:" enter the new database name.

    phpMyAdmin - Rename Database

  5. Click the Go button.
  6. When it asks you to want to create the new database and drop the old database, click OK to proceed. (This is a good time to make sure you spelled the new name correctly.)

    Rename Database Confirmation

  7. Once the operation is complete, click OK when asked if you want to reload the database.

Step 2: Reconfiguring User Permissions

If your hosting plan has cPanel, you must reconfigure user permissions.

  1. Go back to the main cPanel page.
  2. Click on MySQL Databases.

    cPanel - MySQL Databases

  3. Scroll down to the Add User To Database section of the page.

    MySQL Databases - Add User to Database

  4. Select the database from the list (it should be the new name).
  5. Select the database user from the list (the same one that used to be associated with this database).
  6. Click on Add button.
  7. Check the box next to All Privileges on the Manage User Privileges page.

    Manage User Privileges

  8. Click on the Make Changes button.

Step 3: Update the Scripts

You may need to update any scripts or applications that reference this database since the name has changed if you want them to continue to have access to this database.

 

Did you find this article helpful?

 
* Your feedback is too short

Loading...