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.

3. Create a database.

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

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

-Select ALL PRIVILEGES then click Make Changes.

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

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.

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 andpassword 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

Was this article helpful?

Related Articles

Leave A Comment?