How do I create a MySQL database and user?

Below is a guide to creating a MySQL Database. MySQL databases are used by many web applications including content management systems, blogs and e-commerce. A MySQL database also requires a MySQL user with correct privileges to access and edit the MySQL database. The easiest way to create the database, user and correct privileges is to use the MySQL Database Wizard in cPanel.

To create/add a MySQL database and user, first log in to your cPanel:

Once logged in, towards the bottom of the page click on MySQL Database Wizard

On the MySQL Database Wizard page, the first step is to create the database. To do this we need to enter a Database Name. Enter a name which can give a brief description to the database, eg shop, clients etc. The database name will be prefixed with your account username. Once a name has been entered click Next Step.

The next step is to create the database user. Enter a Username and Password of your choosing. You will then need to confirm the password by entering it again. Once this is done click Create User.

The next step is to add the user you just created to the database you just created. This is done by giving Privileges to the user on the database. It is recommended to give the user all privileges to the database. Click on the checkbox next to All Privileges and then click Next Step.

The database and user have now been created and the user has had the correct privileges assigned to the database. The MySQL database is now ready to be used by your web application!

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I backup my site?

To backup your website, or parts of it (Home Directory, MySQL etc) first log in to your cPanel:...

How do I use the File Manager?

From within cPanel you can access your online File Manager. This allows you to manage the...

How do I administer my MySQL database?

To administer/manage your MySQL database we provide the popular program phpMyAdmin. The program...

How do I view my website statistics?

We provide several different statistics programs within cPanel for you to view and analyse your...

How do I password protect a directory?

From within cPanel you can password protect a folder. This allows you to require a username and...