How to Set Up a MySQL Database & User in cPanel (2 Easy Methods)

MySQL Database

How to Create a MySQL Database

If you’re setting up a website that needs to store data, whether it’s a WordPress blog, an eCommerce store, or a custom web application, you’ll need a MySQL database. If you’re using cPanel, the process is straightforward! In this guide, I’ll walk you through two easy ways to create a MySQL database and user in cPanel: using the Database Wizard and the manual approach.

Let’s get started!

Method 1: Using the MySQL Database Wizard (Recommended for Beginners)

The MySQL Database Wizard is the easiest way to create a database and user in cPanel. It guides you through the process step by step.

Step 1: Access the MySQL Database Wizard

  1. Log in to your cPanel account.
  2. Scroll down to the Databases section.
  3. Click on MySQL Database Wizard.
Database Wizard

Step 2: Create a New Database

  1. In the first step of the wizard, enter a name for your new database (e.g., prod9).
  2. Click Next Step.
New Database

Step 3: Create a Database User

  1. Enter a username (e.g., prod9).
  2. Set a strong password (or use the Password Generator to create one).
  3. Click Create User.
Database User

Step 4: Assign Privileges to the User

  1. You’ll now need to assign permissions to your user.
  2. Check the box for All Privileges (recommended for most applications).
  3. Click Next Step to finish.
Assign Privileges
Final Result
Database Name: pdwoeuds_prod9
Database User: pdwoeuds_prod9
Database Pass: Your provided password
Database Hostname: localhost
Database PORT: 3306

🎉 Congratulations! Your new database and user have been created successfully. You can now use them to connect your website to the database.

Suggested Reading: How to Import a Database in cPanel Using phpMyAdmin

Method 2: Manually Creating a Database and User in cPanel

If you prefer more control over the process, you can manually create a database, a user, and link them together. Here’s how:

Step 1: Create a Database

  1. Log in to cPanel.
  2. Scroll to the Databases section and click on MySQL Databases.
  3. Under Create New Database, enter a name for your database (e.g., prod9).
  4. Click Create Database.

Step 2: Create a Database User

  1. Scroll down to the MySQL Users section.
  2. Under Add New User, enter a username (e.g., prod9).
  3. Set a secure password (or use the Password Generator).
  4. Click Create User.

Step 3: Link the User to the Database

  1. Scroll to the Add User to Database section.
  2. Select the user and database from the dropdown menus.
  3. Click Add.
  4. Assign All Privileges (recommended) and click Make Changes.

That’s it! Your MySQL database is now ready for use. 🚀

Import Your Database Using phpMyAdmin

  1. Go back to your cPanel dashboard.
  2. Locate and click on phpMyAdmin in the Databases section.
  3. In the left panel, find and click on the database you just created.
  4. At the top, click the Import tab.
  5. Click Choose File and select the database file from your local computer.
  6. Click Go to start the import process.

That’s it! Your MySQL database is now ready for use. 🚀

Frequently Asked Questions (FAQs)

Final Thoughts

Whether you choose the MySQL Database Wizard or the manual method, cPanel makes it easy to create databases and users. If you’re setting up WordPress or another CMS, you’ll need these database details to complete the installation.

Need help connecting your database to your application? Reach out to Aveshost Support or Let me know in the comments! 😊

Happy coding! 🎉

Suggested Reading:

Picture of Kennedy Dzigbenyo

Kennedy Dzigbenyo

Kennedy Dzigbenyo is a dedicated Software Engineer and WordPress Expert whose expertise lies in turning conceptual digital dreams into tangible realities. He excels in the art of creating digital solutions that respond to contemporary needs.

Leave a Reply

Enjoy 20% Off Your First Order!

Use promo code WELCOME at checkout to claim your exclusive discount.

Get 20% OFF on your first order

Oh hi there! It’s nice to meet you.

Please Kindly, sign up to receive awesome content in your inbox, every month.