---
title: How to create a database in Control Web Panel (CWP)
description: "Creating a database in **CWP (CentOS Web Panel)** is an essential step for hosting applications like WordPress, Joomla, or custom-built PHP apps that require database functionality. This can be done either from the **[CWP Admin](https://truehost.com/support/knowledge-base/how-to-access-cwp-main-whm-panel/)** panel or **[CWP user's cPanel](https://truehost.com/support/knowledge-base/how-to-access-cwp-users-cpanel/)**…"
url: "https://truehost.com/support/knowledge-base/how-to-create-a-database-in-control-web-panel-cwp/"
updated: "2024-10-04"
category: Cloud servers in Kenya
---

# How to create a database in Control Web Panel (CWP)

Creating a database in **CWP (CentOS Web Panel)** is an essential step for hosting applications like WordPress, Joomla, or custom-built PHP apps that require database functionality.

This can be done either from the **[CWP Admin](https://truehost.com/support/knowledge-base/how-to-access-cwp-main-whm-panel/)** panel or **[CWP user's cPanel](https://truehost.com/support/knowledge-base/how-to-access-cwp-users-cpanel/)**

### Prerequisites:

- **CWP installed** on your server.
- **Root access** or a **user account** in CWP.

## A. Using the CWP Admin

##### **Step 1: Log in to the CWP Admin Panel** using **[these steps](https://truehost.com/support/knowledge-base/how-to-access-cwp-main-whm-panel/)**

**Step 2: Navigate to MySQL Manager**

- Once logged in, go to the left-hand side menu.
- Under the **SQL Services** section, click on **MySQL Manager**.

![](https://truehost.com/support/wp-content/uploads/2024/10/image-129.png)

##### **Step 3: Create a New Database**

- In **MySQL Manager**, you will see an option to **Create Database**. Click on it.
- You will be prompted to enter the following information:
  - **User Account**: Select the domain user that the database will belong to. This is NOT the user for database access but the domain for which you are creating the database.
  - **Name**: Enter a name for the new database (e.g., `mydatabase`).
  - **Charset**: Leave the default
- Once all the details are filled out, click the **Save** button to generate the database

![](https://truehost.com/support/wp-content/uploads/2024/10/image-130-1024x431.png)

- The database will be created and you will be taken to a list of all databases. I identify your database from the list.

**Step 3: Create a User for the database and assign to it**

- Your database was created but it has no user to access it. To associate a user to it, click the ***Add user to this database button***, just on the left side of your database. See the image below

![](https://truehost.com/support/wp-content/uploads/2024/10/image-131-1024x489.png)

- You will be presented with a form to fill fill user details. Fill them as you prefer. You may want to save the password for later use, so that you do not have to reset it.
- Also, be keen to Click on User privileges option and assign the user all privileges to the DB. See the image below
- Once done, click on **Save**

![](https://truehost.com/support/wp-content/uploads/2024/10/image-133.png)

- You will now see that the DB has been associated with the user that you just created.

![](https://truehost.com/support/wp-content/uploads/2024/10/image-134.png)

- You may now connect the database to your website or use it as you intended.

If your server is with **Truehost**, you may reach our **[support team](https://wa.me/19726743814)** in case you need further guidance.
