---
title: How to Create a MySQL Database and User in cPanel
description: "**In short:** In cPanel open **MySQL Databases**: create the database under **Create New Database**, add a user under **MySQL Users → Add New User**, then under **Add User To Database** choose both, click **Add**, tick **All Privileges** and click **Make…"
url: "https://www.hyyat.com/en/knowledgebase/create-mysql-database-cpanel/"
updated: "2026-10-21"
category: Website control panel ( cpanel )
---

# How to Create a MySQL Database and User in cPanel

**In short:** In cPanel open **MySQL Databases**: create the database under **Create New Database**, add a user under **MySQL Users → Add New User**, then under **Add User To Database** choose both, click **Add**, tick **All Privileges** and click **Make Changes**.

## Step 1: Create the database

1. Log in to cPanel (see [how to log in to cPanel](https://www.hyyat.com/en/knowledgebase/how-to-log-in-to-cpanel/)).
   ![إنشاء قاعدة بيانات وربط إسم المستخدم بها](https://hyyathost.com/images/2017/04/16/cPanel-logo.png)
2. In the **Databases** section, click **MySQL Databases**. cPanel looks slightly different between versions, but the options are the same.
   ![إنشاء قاعدة بيانات وربط إسم المستخدم بها](https://hyyathost.com/images/2017/04/17/pl_mysql_1.png)
3. Under **Create New Database**, type a name and click **Create Database**.
   ![Create New Database](https://hyyathost.com/images/2017/04/17/pl_mysql_2.png)

## Step 2: Create a database user

1. On the same page, under **MySQL Users → Add New User**, enter a username and a strong password (letters and numbers), then click **Create User**.
   ![سنجد كلمة ( MySQL Users ) وتحتها كلمة ( Add New User ) ](https://hyyathost.com/images/2017/04/17/pl_mysql_3.png)
2. Or click **Password Generator** to create a strong password automatically, and save it.
   ![نقوم بالضغط عليPassword Generator لتوليد باسورد تلقائي واستخدمها](https://hyyathost.com/images/2017/04/17/pl_mysql_4.png)

   ![How to Create a MySQL Database and User in cPanel - screenshot 1](https://hyyathost.com/images/2017/04/17/pl_mysql_5.png)

## Step 3: Assign the user to the database

1. Under **Add User To Database**, choose the user and the database you just created and click **Add**.
   ![نختار إسم المستخدم وإسم القاعده الذين تم انشاءهما للتو ونضغط ( Add )](https://hyyathost.com/images/2017/04/17/pl_mysql_6.png)
2. Tick **All Privileges**, then click **Make Changes**.
   ![All Privileges](https://hyyathost.com/images/2017/04/17/pl_mysql_7.png)

   ![Make Changes](https://hyyathost.com/images/2017/04/17/pl_mysql_8.png)

   ![تم اعطاء الصلحيات وتم ربط المستخدم والقاعدة](https://hyyathost.com/images/2017/04/17/pl_mysql_9.png)

**Note:** cPanel adds your account prefix to database and user names. When a script asks for them, use the full names, for example **user_dbname**.

Next: [install WordPress with your new database](https://www.hyyat.com/en/knowledgebase/install-wordpress-on-cpanel-hosting/).

Related service: [cPanel shared hosting](https://www.hyyat.com/en/shared-hosting-2/) from Hyyat Host, with support that replies within 24 hours.

 **Related guides**

- [How to change PHP version](https://www.hyyat.com/knowledgebase/%d9%83%d9%8a%d9%81-%d9%8a%d8%aa%d9%85-%d8%aa%d8%ba%d9%8a%d8%b1-%d8%a7%d8%b5%d8%af%d8%a7%d8%b1-php-%d9%85%d9%86-%d8%af%d8%a7%d8%ae%d9%84-%d8%a7%d9%84%d8%b3%d9%8a-%d8%a8%d9%86%d9%84/)
- [How to Log in to cPanel](https://www.hyyat.com/knowledgebase/%d8%b4%d8%b1%d8%ad-%d8%a7%d9%84%d8%af%d8%ae%d9%88%d9%84-%d8%a7%d9%84%d9%8a-%d8%a7%d9%84%d8%b3%d9%8a-%d8%a8%d9%86%d9%84/)

  **Need this service from Hyyat Host?**Our team handles it for you, with support replying to tickets within 24 hours at most.[Web Hosting](https://www.hyyat.com/en/hosting/)[Saudi Hosting](https://www.hyyat.com/en/saudi-hosting/)
