How to rename a database in cPanel? (Video)

 

cPanel does not provide a direct option to rename a database through its interface. However, you can achieve this by following a workaround that involves creating a new database, importing the data, and updating any necessary configurations.


Step 1: Log in to cPanel

  1. Open your web browser and go to your cPanel login page (e.g., https://yourdomain.com:2083).
  2. Enter your username and password, then click Log in.

Step 2: Backup the Existing Database

  1. Go to the Databases section in cPanel.
  2. Click on phpMyAdmin.
  3. In the left panel, select the database you want to rename.
  4. Click Export in the top menu.
    • Choose Quick export method and format as SQL.
    • Click Go to download the database backup.

Step 3: Create a New Database

  1. Return to the cPanel dashboard and navigate to the Databases section.
  2. Click on MySQL Databases.
  3. Under the Create New Database section, enter the desired name for the new database.
  4. Click Create Database.

Step 4: Create or Assign a Database User

  1. In the MySQL Databases section, scroll to the Add New User section.
  2. Create a new database user (or use an existing one).
  3. Assign the user to the newly created database:
    • Under Add User to Database, select the user and the new database.
    • Click Add and assign All Privileges.

Step 5: Import Data into the New Database

  1. Go back to phpMyAdmin in the Databases section of cPanel.
  2. Select the new database from the left panel.
  3. Click Import in the top menu.
  4. Choose the previously exported .sql file and click Go to import the data into the new database.

Step 6: Update Configuration Files

If your website or application uses this database, update the database credentials in its configuration files. For example:

  1. Open the wp-config.php file (for WordPress) or the relevant configuration file for your CMS/application using the File Manager or an FTP client.
  2. Update the following:
    • Database Name: Replace the old database name with the new one.
    • Database User: Update the username if it was changed.
    • Database Password: Update the password if it was changed.

Step 7: Test Your Website or Application

  1. Load your website or application to ensure it connects to the new database.
  2. Verify that all functionality is working as expected.

Step 8: Delete the Old Database

  1. Once you confirm that everything is working correctly, return to the MySQL Databases section in cPanel.
  2. Under the Current Databases section, locate the old database.
  3. Click Delete to remove the old database.

Tips for Renaming a Database

  • Backup Everything: Always create a full database backup before starting.
  • Double-Check Credentials: Ensure all configuration files point to the new database.
  • Test Thoroughly: After importing the data and updating settings, test your website or application to confirm smooth operation.

By following these steps, you can effectively rename a database in cPanel while ensuring minimal downtime and maintaining functionality.

 
  • 1 gebruikers vonden dit artikel nuttig
Was dit antwoord nuttig?

Gerelateerde artikelen

How to create a database in cPanel? (Video)

  Creating a database in cPanel is an essential step for hosting dynamic websites or...

How to delete a database in cPanel? (Video)

  Deleting a database in cPanel is a straightforward process. Follow these steps to...

How to Create a Database Username in cPanel? (Video)

  Creating a database username in cPanel is essential for managing access to your databases....

How to add a user to a database and add privileges? (Video)

  Adding a user to a database and assigning appropriate privileges is crucial for managing...

How to import database via phpMyAdmin in cPanel? (Video)

  Importing a database using phpMyAdmin in cPanel is a straightforward process that allows you...