Knowledgebase

How to Create and Manage MySQL Databases and Users in cPanel

  • 0

How to Create and Manage MySQL Databases and Users in cPanel

 

Managing MySQL databases and users in cPanel is an essential task for website and application management. With cPanel, you can easily create databases, add users, assign permissions, and delete unused databases or users through a simple interface.

 

Step 1: Login to cPanel from Client Area

 

First, login to your client area account.

After logging in:

  1. Go to Services
  2. Click on My Services
  3. Select your active hosting service
  4. Click on Login to cPanel

 

 

 

 

Step 2: Open MySQL® Databases

 

After logging in to cPanel:

  •      Scroll down to the Databases section.

 

 

  •   Click on Manage My Databases

 

 

 

Step 3: Create a New Database

 

Under the Create New Database section:

  1. Enter your database name in the text box.
  2. Click on Create Database.

Example:

  • Database Name: mywebsite_db

Note: cPanel automatically adds your account username as a prefix to the database name.

 

 

 

Step 4: Database Created Successfully

 

After clicking the button, you will see a success message confirming that the database has been created.

Click Go Back to return to the MySQL Databases page

 

 

 

 

How to Create a MySQL User in cPanel

 

Step 5: Create a New Database User

 

Scroll down to the MySQL Users section.

  1. Enter a username in the Username field.
  2. Enter a strong password.
  3. Re-enter the password for confirmation.
  4. Click on Create User.

You can also use the Password Generator option to create a secure password.

 

 

 

Step 6: User Created Successfully

 

After clicking Create User, a success message will appear confirming that the MySQL user has been created.

Click Go Back to continue.

 

 

 

How to Assign a User to a Database

 

Step 7: Add User to Database

 

Scroll to the Add User To Database section.

  1. Select the database user from the User dropdown menu.
  2. Select the database from the Database dropdown menu.
  3. Click on Add.

 

 

 

 

Step 8: Assign Database Privileges

 

On the next page:

  1. Select ALL PRIVILEGES if you want the user to have full access.
  2. Or select specific permissions as required.
  3. Click on Make Changes.

The database user is now successfully assigned to the database.

 

 

 

 

How to Delete a MySQL Database

 

Step 9: Open Current Databases Section

 

Scroll down to the Current Databases section.

Here you will see all databases available in your cPanel account.

 

 

 

Step 10: Delete the Database

 

  1. Find the database you want to remove.
  2. Click on the Delete option beside the database name.

 

 

   

 

  3.  A confirmation popup will appear.

  4.  Click Delete Database to confirm.

 

 

Warning: Deleting a database permanently removes all data stored inside it.

  • Database deleted Successfully

 

 

 

Conclusion

 

cPanel makes it easy to create MySQL databases, create database users, assign users to databases, and remove databases whenever needed. Always keep your database credentials secure and take backups before deleting important databases.

 


Was this answer helpful?