How to Host a Database Driven Website in cPanel

Database driven websites are powerful. Our hosting packages allow for hosting websites that use databases in the backend. Supported databases include MySQL and PostegreSQL

The only difference between hosting a non-database driven website and website driven website is that a database driven website require database set up and upload.

Setting up database for a website, during web hosting

1.Login to your cPanel

2.Navigate to Databases section and click MySQL Database Wizard

3.Type in a database name, click Next. Then type in user as well as password then click Create User. Save the password as you will need it later.

4.On the next page, select ALL PRIVILEGES then Make Changes

5.Then click Next Step

Points to Note

  • In cPanel, databases do not use the root user the way you do on localhost (your phpMyAdmin on your PC)
  • We recommend generating a password instead of typing one.
  • The database username and password have cpanel username per-prended on them eg cpanluser_databasename. Use the this in full and not just what you typed in.

At this point make sure you have saved your database name, your database username and your database password in a text file for use in your website.

6. Export your database from your localhost (local development environment) to a .sql file or .zip file if you are dealing with large database.

7.Go back to the cPanel page and click phpMyAdmin icon

8.Choose the database created earlier from the left side panel

9.Click on Import option

Browse the location of your exported database and select it

On Successful import – you will have uploaded your database

Upload your website files

1.Follow this guide to upload your files

2.Find your database config file and update the following 4 fields.

  • host – should be localhost
  • username – should be the user name created in the steps above
  • password – should be the password created in the steps above
  • database – should be the database name created in the steps above

Bingo – u r live now.

Was this article helpful?

Related Articles

Leave A Comment?