How to Create MySQL Database

Introduction

A MySQL database stores website data such as:

Most PHP applications like WordPress, Laravel, Joomla, Magento, and WHMCS require a MySQL database.

cPanel allows you to easily create and manage MySQL databases.


What You Need Before Creating a Database

Before starting, ensure you have:


Step 1: Log in to cPanel

Open your cPanel login URL:

https://yourdomain.com:2083

or access through:

https://my.govaio.com/login

Enter your cPanel username and password.


Step 2: Open MySQL Databases

After logging in:

  1. Navigate to the Databases section

  2. Click:

MySQL Databases

Understanding MySQL Components

Before creating the database, it is important to understand:

Component

Purpose

Database

Stores website/application data

Database User

Account used to access database

Privileges

Permissions granted to user


Step 3: Create New Database

Under Create New Database:

Enter database name.

Example:

website_db

Click:

Create Database

Database Naming Format

Most cPanel servers automatically prefix database names with your cPanel username.

Example:

cpaneluser_website_db

Step 4: Create MySQL User

Scroll to:

MySQL Users

Enter:

Field

Example

Username

website_user

Password

StrongPassword@123


Generate Strong Password

Use the Password Generator for better security.

Recommended password features:


Click:

Create User

Step 5: Add User to Database

Under:

Add User To Database

Select:

Click:

Add

Step 6: Assign Database Privileges

Select required permissions.

For most applications, select:

ALL PRIVILEGES

Then click:

Make Changes

Your Database is Ready

You now have:


Example Database Credentials

Setting

Example

Database Name

cpaneluser_website_db

Database User

cpaneluser_website_user

Password

YourPassword

Database Host

localhost


Common Database Host

Most cPanel hosting servers use:

localhost

How to Use Database in Applications

Applications like WordPress require database details during installation.

Example:

Field

Value

Database Name

cpaneluser_website_db

Username

cpaneluser_website_user

Password

YourPassword

Host

localhost


How to Access phpMyAdmin

phpMyAdmin allows you to manage databases visually.

Open phpMyAdmin

  1. Go to cPanel

  2. Open:

phpMyAdmin

You can:


How to Import SQL Database

Steps:

  1. Open phpMyAdmin

  2. Select database

  3. Click:

Import
  1. Upload .sql file

  2. Click:

Go

How to Export Database Backup

Steps:

  1. Open phpMyAdmin

  2. Select database

  3. Click:

Export
  1. Choose format:

  2. Download backup


Common MySQL Errors & Solutions

1. Access Denied Error

Cause:

Wrong username/password or missing privileges.

Solution:


2. Database Connection Failed

Cause:

Incorrect database host or credentials.

Solution:


3. Too Many Connections

Cause:

High database usage.

Solution:


4. Import Size Limit Error

Cause:

Large SQL file.

Solution:


Security Recommendations


Frequently Asked Questions (FAQ)

Q1. What is MySQL used for?

MySQL stores website and application data dynamically.


Q2. What is database host in cPanel?

Usually:

localhost

Q3. Can I create multiple databases?

Yes. Most hosting plans allow multiple databases.


Q4. Where can I manage databases visually?

Using:

phpMyAdmin

inside cPanel.


Q5. Is MySQL required for WordPress?

Yes. WordPress requires a MySQL database.


Need Help?

If you need assistance creating or managing MySQL databases, contact support:

📧 support@govaio.com