rulururu

post A MySQL Database the Foundation of PHP Scripts…How to Create…

February 2nd, 2009

Filed under: Tutorials — David @ 9:11 pm

MySQL (pronounced my sequel) databases are the foundation of many PHP based scripts.  If you are into using commercial scripts or even custom built scripts knowing how to create MySQL databases is a very important step.  The databases do exactly what the name implies, it stores your information within the database.  If you have customer lists, an online store, a mailing list, etc… these are all usually stored within some type of database.  MySQL is one of the most popular due to the fact it’s a free and open source database.  It comes standard with most Linux hosting accounts.

To create a database is very simple.  Since I usually host with CPanel (one of the most popular hosting scripts), I will show you how to create a database with CPanel.  It’s very similar with other hosting control panels so don’t worry if you don’t have CPanel.

Also keep in mind I use the old CPanel X skin although my CPanel is up to date.  The images might look different from your version but it’s basically all the same thing.

MySQL Cpanel Screenshot

Click on MySQL Databases to start creating.

Your admin panel for MySQL should look something like this.

Your admin panel for MySQL should look something like this.

The first thing we'll do is create a database name.  I chose test for this demonstration.

The first thing we'll do is create a database name. I chose test for this demonstration.

Click Create Database.

This is what it looks like once you create the database name.

This is what it looks like once you create the database name.

Now Go Back.

This is where you'd input your username and password for the database.  I used test for both of these fields.

This is where you'd input your username and password for the database. I used test for both of these fields.

Click Create User.

Success.  Our database username and password have been created.

Success. Our database username and password have been created.

Now click Go Back.

Our database, username and password have been created.

Our database, username and password have been created.

Now we have to add the user (username) to the database.  So that we can use it.

99% of the time you will pick all.  If you have to pick something else, the programmer or script install file will let you know.

99% of the time you will pick All. If you have to pick something else, the programmer or script install file will let you know.

You will almost always pick All.  There are very few times (if ever) where you’ll have to select something else.

Click Add User to Database.

Success.  You have created a database with your chosen username and that username now has permissions to manipulate the database.

Success. You have created a database with your chosen username and that username now has permissions to manipulate the database.

Now Go Back.

This is what you should see if you successfully followed the steps.

This is what you should see if you successfully followed the steps.

Since we have successfully installed the database I might as well add some generic tips that will help you install a large bulk of scripts quickly and easily.

A lot of scripts have a configuration file (sometimes called config.php but it can vary) or an online installer.  Some of the information it will ask is host, database name, username, password (for the database).

The host is usually localhost.  That’s it.  You just type “localhost”.  It will work a good portion of the time.

For database name it depends on what hosting control panel you are using.  Since we already have my screenshots up and you can see my username, we’ll use that as the example.  If you look closely at the final screenshot you’ll see all my info that I put in earlier.  So my database name is my CPanel username; deduct underscore test for the script it would be deduct_test.  If you’re not using CPanel it might just be test.

For username it will be deduct_test also.  Remember if it’s not CPanel it might just be test.

For password it will be test.  There is no underscore or control panel username in this.

That’s about it.  All the other information should be pretty easy to figure out.  It will probably include username, password and things like that.

With just this information you should be able to install a good chunk of scripts you find online.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

ruldrurd
Copyright © 2004 - 2010
Custom Request Internet Marketing
P.O. Box 42, Brick, NJ 08723
(732) 948-4953
Entries (RSS) and Comments (RSS)