Sign Up For Web Hosting Now!
PHP & MySQL Services
No.1 CMS Host!
  • CMS-optimized servers
  • FREE CMS installation
  • FREE CMS templates
  • Free Domain name
  • Unlimited space
  • Unlimited traffic
  • Immediate activation
Buy web hosting
Sign up now Learn more
Facebook Twitter Plusone

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 SiteGround's hosting plans, can be easily accomplished. In order to create a MySQL database on your hosting account, you need to log in cPanel. This can be done by either using the Go to cPanel button in the Customer Area ->My Accounts section or by entering one of the following URLs in your web browser:

http://yourdomainname.com/cpanel
http://cpanel.servername.com

Important You should replace "yourdomainname.com" with your actual domain name or "servername.com" with the hostname of the SiteGround server on which your account is hosted.

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


In order to create a new database you need to enter the desired name for the database in the New Database field and click on the Create Database button as shown below:

Create New Database

A confirmation screen will be displayed, informing that the database has been successfully created:


You can click on the Go Back button to return 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 continue with the creation of a user who should be able to connect to the newly created database. To create a user you just need to fill in the desired user name and password as shown in the image below:

Add New User

Click Submit to save your MySQL username.

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

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 them both from the corresponding drop-down menus under Add User To Database label and click on 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 and click on the Make Changes button:

Manage User Privileges

Using the MySQL Database Wizard

All of the steps above can be accomplished using the MySQL Database Wizard. Click on it and you will be guided trough all steps that you should perform in order to successfully create a new MySQL database and add a user to it.

MySQL Database Wizard

Previous Next
(c) Copyright 2004-2013 SiteGround. All rights reserved
SiteGround is not affiliated with or endorsed by the MySQL Project or its trademark owners.