---
title: How to upload and configure MySQL database into cPanel
description: "If you have created your database driven website on localhost and want to upload the database to cPanel, there are a number of easy steps to take to successfully connect your database. Please read along 1. Login to **cPanel** 2.…"
url: "https://truehost.com/support/knowledge-base/how-to-upload-and-configure-mysql-database-into-cpanel/"
updated: "2024-06-07"
---

# How to upload and configure MySQL database into cPanel

If you have created your database driven website on localhost and want to upload the database to cPanel, there are a number of easy steps to take to successfully connect your database. Please read along

1. Login to **cPanel**

2. Navigate to **MySQL Databases** icon.

![](https://truehost.co.ke/support/wp-content/uploads/2020/08/How-to-upload-and-configure-MySQL-database-into-cPanel1.png)

3. Create a database.

![](https://truehost.co.ke/support/wp-content/uploads/2020/08/How-to-upload-and-configure-MySQL-database-into-cPanel2-1024x246.png)

4. Create a **user** and select a **password** for the database user. Save these somewhere as you will need it for your configuration file.

![](https://truehost.co.ke/support/wp-content/uploads/2020/08/How-to-upload-and-configure-MySQL-database-into-cPanel3-1024x401.png)

5.Give the user permissions to manage the database.

- Go to **Add User to Database** section and select the database name, and user you would like to access the database then click **Add**

![](https://truehost.co.ke/support/wp-content/uploads/2020/08/How-to-upload-and-configure-MySQL-database-into-cPanel4-1024x258.png)

-Select **ALL PRIVILEGES** then click **Make Changes.**

![](https://truehost.co.ke/support/wp-content/uploads/2020/08/How-to-upload-and-configure-MySQL-database-into-cPanel5.png)

6. Go back to cPanel main page and navigate to **phpMyAdmin**.

![](https://truehost.co.ke/support/wp-content/uploads/2020/08/How-to-upload-and-configure-MySQL-database-into-cPanel6.png)

7. Your database will display there. Select it first then click**Import**

8. Click **Browse** and select your .**sql** file from your computer and click **Go at the bottom of the page**. Allow it to complete upload.

![](https://truehost.co.ke/support/wp-content/uploads/2020/08/How-to-upload-and-configure-MySQL-database-into-cPanel7-1024x471.png)

9. Now, navigate to your **configuration** file. This depends on what you named it e.g config.php, database.php, configuration.php, connect.php etc

10. Fill in the details, with the correct **hostname,****database,****username**and**password** as follows:

***Hostname***: this is always **localhost**

***Username***: username of your database as created in step4 e.g **truehost_user**

***Password***: password selected in step 4

***Database***: the name of the database as created **truehost_database**
