How to Create a MySQL Database and User

From Free Hosting Wiki
(Difference between revisions)
Jump to: navigation, search
[checked revision][quality revision]
 
(6 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
Once you are logged in to cPanel, click on '''MySQL® Database Wizard''' under '''Databases'''.  From here, you can create a database and a user to access the database.
 
Once you are logged in to cPanel, click on '''MySQL® Database Wizard''' under '''Databases'''.  From here, you can create a database and a user to access the database.
  
 +
[[Image:Database_wizard.png|border]]
  
 
First, you will need to choose a database name.  This will be in the format of username_example where username is your cPanel username and example is your database name.  The overall database name can not be more than 16 characters.
 
First, you will need to choose a database name.  This will be in the format of username_example where username is your cPanel username and example is your database name.  The overall database name can not be more than 16 characters.
 +
 +
[[Image:Database_wizard2.png|border]]
  
 
Next, you will need to create a user to access the database.  The username can not be more than 7 characters.  You will need to enter a password twice for verification.
 
Next, you will need to create a user to access the database.  The username can not be more than 7 characters.  You will need to enter a password twice for verification.
 +
 +
 +
[[Image:Database_wizard3.png|border]]
  
 
Last, you will be asked what privileges you would like to give to the user you created in the previous step.  It is recommended to select '''ALL PRIVILEGES''' to avoid errors later on.  If you know what all the privileges do, you can modify them to your needs.
 
Last, you will be asked what privileges you would like to give to the user you created in the previous step.  It is recommended to select '''ALL PRIVILEGES''' to avoid errors later on.  If you know what all the privileges do, you can modify them to your needs.
 +
 +
 +
[[Image:Database_wizard4.png|border]]
  
 
== Creating only a database ==
 
== Creating only a database ==
Line 22: Line 31:
  
  
There will a box at the top of the page that will allow you to create a database:
+
There will a box at the top of the page that will allow you to create a database:  
[[Image:Create_new_database.png]]
+
  
 +
 +
[[Image:Create_new_database.png|border]]
  
 
All you need to do is enter your database name. The database name can't be more than 16 characters overall.  Your database name will be in the format of username_example where username is your cPanel username and example is the database name you chose above.
 
All you need to do is enter your database name. The database name can't be more than 16 characters overall.  Your database name will be in the format of username_example where username is your cPanel username and example is the database name you chose above.
 +
 
== Creating only a user ==
 
== Creating only a user ==
 +
Click on '''MySQL® Databses''' in cPanel under '''Databases'''.
  
 +
Under the list of your current MySQL databases, you will be able to create a user for your databases:
  
Click on '''MySQL® Databses''' in cPanel under '''Databases'''.
 
== Adding a user to a database ==
 
  
 +
[[Image:Add_new_user.png|border]]
  
 +
You will need to enter your desired database username and its password twice for verification.  The username can't be longer than 7 characters.
 +
 +
== Adding a user to a database ==
 
Click on '''MySQL® Databses''' in cPanel under '''Databases'''.
 
Click on '''MySQL® Databses''' in cPanel under '''Databases'''.
 +
 +
At the bottom of the page, you will be able to add your MySQL database users to your MySQL databases:
 +
 +
 +
[[Image:Add_user_to_database.png|border]]
 +
 +
Once you have completed this step, you will be taken to another page  where you can select which privileges you would like to give this user.
 +
 +
 +
[[Image:Database_privileges.png|border]]
 +
 +
It is suggested that you select '''ALL PRIVILEGES''' as in the above picture.  After hitting '''Make Changes''' your MySQL database user will be added to the MySQL database you chose. 
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]
 
[[Category:KB]]
 
[[Category:KB]]

Latest revision as of 22:41, 9 August 2010

It is not possible to create a database using phpMyAdmin or anything outside cPanel. To create a MySQL database or user, you must use the tools provided in cPanel.


Contents

[edit] Using the MySQL® Database Wizard

To access the MySQL® Database Wizard, you will first need to login to cPanel. If you do not know how to login to cPanel, click here.


Once you are logged in to cPanel, click on MySQL® Database Wizard under Databases. From here, you can create a database and a user to access the database.

Database wizard.png

First, you will need to choose a database name. This will be in the format of username_example where username is your cPanel username and example is your database name. The overall database name can not be more than 16 characters.

Database wizard2.png

Next, you will need to create a user to access the database. The username can not be more than 7 characters. You will need to enter a password twice for verification.


Database wizard3.png

Last, you will be asked what privileges you would like to give to the user you created in the previous step. It is recommended to select ALL PRIVILEGES to avoid errors later on. If you know what all the privileges do, you can modify them to your needs.


Database wizard4.png

[edit] Creating only a database

Click on MySQL® Databses in cPanel under Databases.


There will a box at the top of the page that will allow you to create a database:


Create new database.png

All you need to do is enter your database name. The database name can't be more than 16 characters overall. Your database name will be in the format of username_example where username is your cPanel username and example is the database name you chose above.

[edit] Creating only a user

Click on MySQL® Databses in cPanel under Databases.

Under the list of your current MySQL databases, you will be able to create a user for your databases:


Add new user.png

You will need to enter your desired database username and its password twice for verification. The username can't be longer than 7 characters.

[edit] Adding a user to a database

Click on MySQL® Databses in cPanel under Databases.

At the bottom of the page, you will be able to add your MySQL database users to your MySQL databases:


Add user to database.png

Once you have completed this step, you will be taken to another page where you can select which privileges you would like to give this user.


Database privileges.png

It is suggested that you select ALL PRIVILEGES as in the above picture. After hitting Make Changes your MySQL database user will be added to the MySQL database you chose.

Personal tools
Namespaces

Variants
Actions