How to create MySQL database and user

Jesse

Active Member
Messages
1,360
Reaction score
0
Points
36
Creating a MySQL Database

Creating a MySQL database with cPanel, which is included in all of the SiteGround's Linux hosting plans can be asily 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:

image1.jpg

or you may use one of the following URL':
http://yourdomain.com/cpanel
http://cpanel.servername.com

bullet4.gif
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.

image2.jpg

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:

image4.jpg

bullet4.gif
Feel 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:

image5.jpg

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

bullet4.gif
Please note that the MySQL database is being created with your username as prefix - username_databasename, and this is the name you have to use for your application.
Creating a MySQL username

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:

image6.jpg

Again a confirmation page will be loaded.

bullet4.gif
You 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

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:

image7.jpg

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:

image8.jpg

Please, click here for CPanel video tutorial about:
Creating and modifying MySQL databases in cPanel.

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.


image13.jpg

Source: http://www.siteground.com/tutorials/php-mysql/mysql_database_user.htm
 
Last edited:

chewett

New Member
Messages
137
Reaction score
0
Points
0
very good and simple

perhaps add how to create the tables as well
 

sunils

New Member
Messages
2,266
Reaction score
0
Points
0
nice tutorial about the usage of cpanel to create and configure mysql.
 

thefreek

New Member
Messages
2
Reaction score
0
Points
0
Sorry, you have exceeded the maximum allowed databases.

---

I don't get why i get this message, as i don't have any other databases. I only have two x10hosting accounts.

Could anyone help me please? my msn is the.freek-1337@hotmail.com
 
Top