> ## Documentation Index
> Fetch the complete documentation index at: https://speedypage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage MySQL databases

> How to manage database users, privileges, and maintenance tasks like renaming, checking, repairing, and deleting databases in cPanel.

This page covers day-to-day database management in cPanel — assigning user privileges, renaming databases, checking for errors, and cleaning up databases you no longer need.

If you need to create a new database from scratch, see [Create a MySQL database](/web-hosting/create-database). For importing and exporting data, see [Import and export MySQL databases](/web-hosting/database-import-export).

## Open the database manager

Log in to cPanel through your [client area](https://my.speedypage.com) or at `yourdomain.com/cpanel`. Go to **Databases** > **MySQL Databases** (also called **Manage My Databases** in newer cPanel versions).

## Manage user privileges

When you add a user to a database, you choose what that user can do. For most web applications, **ALL PRIVILEGES** is the right choice. If you need more control — for example, giving a user read-only access — select individual privileges instead.

### Add a user to a database

<Steps>
  <Step title="Select the user and database">
    In the **Add User To Database** section, pick the user and database from the dropdown menus.
  </Step>

  <Step title="Click Add">
    The privilege selection screen appears.
  </Step>

  <Step title="Choose privileges">
    Select the checkboxes for the privileges you want to grant. Select **ALL PRIVILEGES** to grant full access. Click **Make Changes**.
  </Step>
</Steps>

### Change a user's privileges

In the **Current Databases** table, find the database and click the username listed under **Privileged Users**. This opens the same privilege screen where you can select or deselect individual privileges. Click **Make Changes** to save.

### Remove a user from a database

In the **Current Databases** table, click the trash icon next to the user you want to remove, then click **Revoke User Privileges from Database**. This removes the user's access to that database but doesn't delete the user account.

## Rename a database

<Steps>
  <Step title="Find the database">
    In the **Current Databases** table, click **Rename** next to the database.
  </Step>

  <Step title="Enter the new name">
    Type the new name and click **Proceed**.
  </Step>
</Steps>

<Warning>
  Renaming a database disconnects all active connections to it. You'll also need to update any configuration files (like `wp-config.php`) that reference the old database name. Back up the database before renaming it.
</Warning>

Behind the scenes, cPanel creates a new database, moves the data over, recreates grants and stored procedures, then deletes the old database. Larger databases take longer to rename.

## Check a database for errors

If a site is behaving unexpectedly — queries failing, data not loading — a corrupted database table could be the cause.

In the **Modify Databases** section, select the database from the **Check Database** dropdown and click **Check Database**. cPanel examines each table and reports whether it found problems. If it names a specific table, that table is corrupt and should be repaired.

## Repair a database

In the **Modify Databases** section, select the database from the **Repair Database** dropdown and click **Repair Database**. cPanel attempts to fix any corrupt tables automatically.

If the repair succeeds, you'll see a "Repair Complete" message. If it fails, cPanel reports which tables couldn't be repaired — in that case, restoring from a backup may be your best option.

## Delete a database

In the **Current Databases** table, click **Delete** next to the database, then confirm by clicking **Delete Database**.

<Warning>
  This permanently removes the database and all its data. Make sure you have a backup if you might need the data later.
</Warning>

## Manage database users

The **Current Users** table at the bottom of the page lists all database users on your account. From here you can:

| Action                   | How                                                                      |
| ------------------------ | ------------------------------------------------------------------------ |
| Change a user's password | Click **Change Password**, enter the new password, and confirm.          |
| Rename a user            | Click **Rename**, enter the new username, and click **Change Username**. |
| Delete a user            | Click **Delete**, then confirm with **Delete User**.                     |

<Note>
  Deleting a database user doesn't delete the databases they had access to, and deleting a database doesn't delete the users assigned to it. These are separate operations.
</Note>

<Tip>
  Don't use phpMyAdmin to create databases or users. Databases created through phpMyAdmin aren't tracked by cPanel, which causes problems with backups and account migrations.
</Tip>
