Manage MySQL Databases in CPanel
In this tutorial we'll show you how to create, manage, and delete MySQL databases and database users.
Go to Cpanel > Databases and click MySQL Databases link:
Create a database
We recommend that you use cPanel's MySQL Database Wizard interface to create your first database and user.
In the New Database text box, enter a name for the database and click Create Database button. The new database will appear in the Current Databases table:
Check a database
If you experience problems with a database on your server, check your databases for errors.
In the Check Database menu, select the database that you wish to check and click Check Database.
A new interface will appear, and the system will check whether the database functions correctly. If the system detects a problem in the database, it displays the name of the corrupt table.
If the Check Complete message displays, the database functions correctly.
Repair a database
If one of your databases is corrupt, you can attempt to repair it.
In the Repair Database menu, select the database that you wish to repair and click Repair Database.
The system will attempt to automatically repair the database. If the system cannot repair the database, it will attempt to determine the source of the corrupt data.
If the Repair Complete message displays, the system successfully repaired the database:
The Current Databases table lists the following information for each database in your account:
Database - The name of the database. Size - The size of the database. Privileged Users - The users who can manipulate the database.
To remove a user from a database, click the trashcan icon for the desired user, and then click Revoke User Privileges from Database.
To modify a user's privileges for a specific database, click the desired username, select and deselect checkboxes to configure the desired privileges, and then click Make Changes.
Rename a database
Create a backup of the MySQL database before you attempt to rename it.
Manually update configuration files and applications to use the new database name.
In the Current Databases table, click Rename for the desired database.
Enter the new database name in the New name text box and click Proceed:
MySQL does not allow to rename a database. Actually CPanel will create a new database and will move the data in the new database. Then the old database gets deleted.
Delete a database
In the Current Databases table, click Delete for the desired database.
To permanently delete the database, click Delete Database.
Add a MySQL user
After you create a database, add users to the database and configure their privileges:
Enter a username in the Username text box. Enter and confirm the new password in the appropriate text boxes. Click Create User.
Add a user to a database
In the Add User To Database section of the interface, select the desired user and database from the menus. Click Add:
The MySQL Account Maintenance interface will appear:
Select the checkboxes that correspond to the privileges that you wish to grant to the user.
To grant all of the available privileges to the user, select the ALL PRIVILEGES checkbox.
Click Make Changes.
The Current Users table lists all of your MySQL database users, and allows you to perform the following actions:
Change Password - click to modify a database user's password. Enter and confirm the desired password, and then click Change Password.
Rename - click to rename a database user. Enter the desired username, and then click Change Username:
Delete - Click to permanently delete a database user, and then click Delete User to continue:
MySQL is an indispensable part of almost all modern websites and CMS systems, and the intelligent management of MySQL databases is no longer an option but a necessity.