Web Hosting Line
1.800.828.9231
Display entire tutorial on one page. Print-friendly version.

MySQL Tutorial: Creating MySQL Database and User

Check out the Creating and Modifying MySQL Databases video tutorial:

Creating a MySQL Database Detailed Tutorial

Creating a MySQL database with cPanel, which is included in all of the SiteGround's Linux hosting plans can be easily accomplished. In order to create a MySQL database on your hosting account, you need to log into the cPanel. This can be done by either using the [Go!] button in the Manage Account section of the customer area as shown in the image below:

SiteGround web hosting: Manage accounts -> Go!

or you may use one of the following URL':

http://yourdomain.com/cpanel
http://cpanel.servername.com

Important Please bear in mind, that you have to replace "yourdomain.com" with your actual domain name or servername.com with the hostname of the SiteGround server on which your account is located.

Once you have logged into the cPanel, you can access the MySQL management screen by clicking the [MySQL Databases] button as shown below.

MySQL Databases button

In order to create a new database all you need to do is enter the desired name for the database in the New Database field, then click the [Create Database] button as shown below:

Create Database

ImportantFeel free to check the video tutorial on adding new databases and database usernames that is available on this page. You might find it very helpful.

A confirmation screen like this one will be displayed, informing the database is successfully created:

Create Database

You can click on the [Go Back] button and will be returned to the database management screen.

Important The MySQL database is created with your username as prefix - username_databasename, and this is the name you have to use for your application.

Creating a MySQL Username Detailed Tutorial

You can now continue with the creation of a user, who will be able to connect to the newly created database. Creating a user is much like any other registration. You just need to fill in the desired user name and password like shown in the image below:

Creating a MySQL username

Again a confirmation page will be loaded.

ImportantYou should always bear in mind that a prefix will be added to all databases and usernames you create, which will be your cPanel username.

Adding a user to a MySQL Database Detailed Tutorial

Once the database and the username are created, you can add certain privileges for the user to the database. In order to do so you should select both from the corresponding drop down menu under Add User To Database and click the [Submit] button:

Add User To Database

You will be redirected to a screen where you will be prompted to choose the desired privileges. It is advisable to select All Privileges then click the [Make Changes] button:

MySQL Privileges

Using the MySQL Database Wizard

All of the steps above can be accoplished using the [MySQL Database Wizard]. All you need to click on it and you will be brought trough all steps that you should perform in order to successfully create a new MySQL database and add privileged user to it.

MySQL Database Wizard

Check out the Using MySQL Databases Wizard video tutorial:


PHP Hosting
(c) Copyright 2008 SiteGround Web Hosting Provider. All rights reserved