KNOWNHOST WIKI

User Tools

Site Tools


control-panels:cpanel-whm:how-to-rename-database-in-phpmyadmin

How To Rename Database in phpMyAdmin

Renaming a database in phpMyAdmin is done with a few straightforward steps. As always, it pays to have a recent backup before undertaking operations that impact important data.

Before actually renaming the database, it's a smart plan to check what user has access to the database and what permissions they've been granted. After renaming the database, you'll need to assign the user and privileges to the renamed (new) database.


Checking Users and Privileges

  1. Login to cPanel (if using cPanel)
  2. Click on Databases, then phpMyAdmin
  3. Choose the appropriate database in the left column
  4. Click Users (in the top tabs)
  5. Note any users with privileges
  6. Click Edit Privileges to see what permissions are currently set


Renaming a Database

  1. Login to cPanel
  2. Click on Databases, then phpMyAdmin
  3. Choose the appropriate database in the left column
  4. Click Operations (in the top tabs)
  5. Enter the new database name under the prompt "Rename database to:"
  6. Click Go
  7. You'll be prompted to confirm that you wish to drop the old database and create the new one - Click OK


Add User to a Database via cPanel

  1. Login to cPanel
  2. Click on Databases
  3. Select the database
  4. Select the user
  5. Click Add
  6. You'll be prompted to assign user privileges at which point you'll want to set them as they were in the original database
  7. Click Make Changes


Add User to a Database via phpMyAdmin

  1. Login to cPanel
  2. Click on Databases, then phpMyAdmin
  3. Choose the appropriate database in the left column
  4. Click Users (in the top tabs)
  5. Next to the appropriate user, Click Edit Privileges
  6. Don't set global privileges, skip that section
  7. Choose Database-specific privileges by picking the database name from the dropdown and Click Go
  8. Tick the privileges you want set for the user on the Database-specific privileges section and Click Go
  9. Click on the user Edit Privileges again to confirm that indeed they have the correct configuration


Notes: If you are using cPanel, it is recommended to add the user and set privileges from within cPanel so that backups and restores work properly.

If using cPanel, the database can be renamed within cPanel, Current Databases → Rename, and grants will be assigned to the newly named database all within the one command.

control-panels/cpanel-whm/how-to-rename-database-in-phpmyadmin.txt · Last modified: 2021/01/19 13:29 by Karson N.