Creating a MySQL Database in cPanel

If your new to using web hostng services and are maybe interested in using available MySQL databases within your hosting account you may be wondering how you go about doing that.

Well in this following example which deals with setting up a MySQL database within cPanel you will discover that its not too difficult at all.

You will need to check first to see if cPanel is the control panel in place within your hosting account.

When your logged into cPanel you will see a number of different sections presented to you on one page and one of those is usually labelled MySQL Databases and will have the logo above it, if you click on the logo or the link underneath it, it will take you to the MySQL account maintenance section, and if you dont yet have any databases setup then this section will look quite empty.

Ok, lets begin creating a MySQL database that will be ready for whatever you may need it for, first you want to look for where it says "New Database" and next to it will be an empty input field, within the input field is where you type the name that you want to use for your database, you can name this anything that you want to, after entering the name, click create database and it will take you to a page where it will inform you if you have successfully created the database, if you get a successful message then everything is correct and you can click back to the page that you were previously on.

So now you should be back at the MySQL account maintenance section and will see that you now have one database created.

The next thing that you need to do is create a user account for the database, this is so that either you or someone that you work with on the website has administration access to the database, so you will need to create a username and password.

Underneath the new database section you will see in bold "Current Users" and underneath that are two input fields, to enter your username and password.
Here you enter your desired username in the top input field and your desired password in the input field underneath it and then press create user, and again it should tell you if you have been successful in creating the username and password.

If all is ok then click back to take you to the page that you were previously on again.

So far you have setup the MySQL database and then you have created a username and password, so the next stage is to add the user account to your database and set the privileges for the new database and user account just created.

Underneath the current users section you will see another section titled "Add Users To Your Databases" and underneath that heading is where you will add the user account that you just created to the database.

In the user section you need to select the user name that you created, there will only be one to choose from if no other MySQL databases have been setup on your account before, go ahead and select the name. In front of your chosen name you will see your hosting account login name and an underscore, something like joeblogs_dbname of course with whatever your chosen names are in place of my example.

Next you want to select the database to the right of the username, again there should only be one to choose from if you have never setup a database within the account before. This too will have the hosting account login name with an underscore _ before your chosen database name.

The next thing to do is to select the priviledges given to the user of this database, generally you should tick the box for ALL as you want full access to the MySQL database.
When you have selected ALL in the box click "Add User To Database" and basically your all done.

You now have one MySQL database setup, you have added a user to the database and have granted full priviledges to that particular database.

The database is empty until you install a php script or have someone else work on installation and the creation of your website but generally your ready to roll and have your database ready so that if you decide to run a PHP script then you have your database name, your username and your password ready and these are what are usually added to configuration files and things like that during the installation of a web script.

So anytime that your getting ready to or learning how to install a website script, for a blog, gallery forum or whatever, you should always create your MySQL database first so its ready for you as you work through the script installation process.

Good luck

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Propeller
  • BlinkList
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati
  • E-mail this story to a friend!
  • Live
  • Ma.gnolia

One Response to “Creating a MySQL Database in cPanel”

  1. If your hosting provider is using an up-to-date version of cPanel/WHM, simply login and in the “Databases” section of the interface, click “MySQL(R) Database Wizard” and this will walk you through the entire process automatically.

    If your cPanel interface doesn’t have neatly grouped icons, instead it just looks like myriad of icons, contact your hosting provider and tell them to upgrade to the latest version of cPanel/WHM. The upgrade is of no cost to them.

Leave a Reply