How to create a database and assign user to it?

A database is where information for your website is stored at. It is a collection of information that is organized so that it can be easily accessed, managed and updated. In this post, we will see how to create a database and assign a user to the database in cPanel.

There are two methods to do this.

  1. Using the MySQL database Wizard (quick)
  2. Through MySQL database management page

Using the MySQL database Wizard

  1. Access cPanel and search for ‘Database’ and click the icon that says ‘MySQL Database Wizard’ (third icon in the image)
  2. access database

  3. Enter the database name in Step 1 as shown below. For eg, if you enter ‘test’, the full database name would be username_test (username is your cPanel username). Click on ‘Next step’ once you have enetered the database name
  4. db-wizard-step1

    You cannot use a database to store and retrive information unless you are authorized. For this reason, we will have to create a database user and the provide that user all the required previlages over the database. You can have one or more than one database users assigned to a database with full previlages.

  5. Enter the database user you would like to assign to the database. Use a strong password (or use the password generator) and click on ‘Create User’ to create the user and move to the next step

  6. If you create the user as test, the full database username would be username_test (username is your cPanel username)

  7. Final step would be to assign proper privileges to the user over the database. The wizard would have automatically selected the database you just created to assign this user. Check the box that says ‘All Privileges’ and then click on ‘Next Step’ to finish setup.


You now have the database user ‘username_test’ with full privileges on the database ‘username_test’.

In next page, we see how to set this up without the database wizard.

/ /

Report (Please include link to post while reporting)

Leave a Reply

Your email address will not be published. Required fields are marked *