Archive

Headline

Sharing Information

Visitor

free counters

Trafict & Ranking

SEO Stats powered by MyPagerank.Net
Powered by  MyPagerank.Net Yahoo bot last visit powered by MyPagerank.Net Msn bot last visit powered by MyPagerank.Net

Tutorial : MySQL Database Tutorials

Step 1: How to create and set up a Database

Many people tell me they aren’t very fond of scripts, because the install frightens them a bit. And it’s true: creating a database, importing tables, your site’s root path… if you don’t know what you’re doing, this looks pretty complicated.
Luckily, it is not, once you get the hang of it.
That’s why I’ve created this step-by-step tutorial on how to set up a database.
I’ve included a screenshot for every step of the way.
The red arrows on the screenshots indicate the required action.
(I’ve used cPanel to create the database, as this is the most common way)

Included:
Chapter 1 – Creating Your Database & Database User
Chapter 2- Importing Database Tables In phpMyAdmin
Chapter 3 – Configuring Your Script
1. Creating your database
First, you need to log in to cPanel. You will find it when you load http://www.yourdomain.com/cpanel
When you do, you see the screen below:
Click ‘MySQL Databases’ (see the red arrow)
How to create and set up a Database.
A new screen will appear, showing you a list of all your existing databases and
database users:
How to create and set up a Database.
Scroll down until you see a field and a button that says ‘Create Database’.
How to create and set up a Database.
Give your database a name and click the ‘Create Database’ button.
A new window appears, confirming your action:
How to create and set up a Database.
Click ‘Go Back’ to go back to the previous page.
On that page, scroll down until you see two fields and a button that says ‘Create User’.
How to create and set up a Database.
Choose a username and password, and click the button.
The confirmation screen will appear again. Click ‘Go Back’ to go back to the
previous page.
On that page, scroll down until you see ‘Add Users To Your Database’.
How to create and set up a Database.
In the first drop down menu, select the user you just created. In the second drop
down menu, select the database you just created.
Make sure the box next to ‘ALL’ is checked.
Click the button that says ‘Add User To Database’.
Again you will see a confirmation message. Click ‘Go Back’ to go to the previous
page.
NOTE: a prefix has been added to the database name and username you
entered. Make sure to always include that prefix when you need to add your database info in a script!
Scroll down until you see ‘Access Hosts’. Make a note of what’s written there
(usually, this will be ‘localhost’).
How to create and set up a Database.
Your database has been created and by now you have all the info you need to run your script’s installer (or to manually edit the script’s configuration file):
•    your database name
•    your database username
•    your password
•    your host
follow Step 2 in the next tutorial.

Step 2:Importing Your Database Tables

Most new scripts come with a built-in installer. All that is resuired to install it, is to load the ‘install.php’ page in your browser and enter your database details in the form that is provided. When the information is submitted, the script creates all database tables automatically. Piece of cake.
Unfortunately, very often there’s no such installer included, and you’ll have to create the database tables manually. – don’t worry – there’s othing to it :o )
When this is the case, a separate database file will be included in the script’s folder (extension: ‘.sql’). Usually it’s named ‘db.sql’, but this can be anything. Check your script’s installation manual to find out.
This is the file you need to import into your empty database  to create the database tables. To find out how to do this, read on.
Still on the same page in your cPanel, click ‘phpMyAdmin’.
How to create and set up a Database.
This will open phpMyAdmin in a new window:
How to create and set up a Database.
In the left drop down menu, select the database you’ve just created.
The database name will be followed by ‘(0)’, since you haven’t created any tables yet.
The left frame  will show the following message: ‘No tables found in database’.
In the right frame, click the ‘Import’ tab.
How to create and set up a Database.
Click the ‘Browse’ button.
How to create and set up a Database.
Browse to your script’s folder, select the ‘db.sql’*-file and click ‘Open’.
(*check your script’s installation manual to find out the name of the file that containes the database info)
How to create and set up a Database.
Click ‘Go’ to start the import.
How to create and set up a Database.
When your import has been successful, your tables will be created. In the left
frame, you’ll see the number of tables that have been created appear behind
your database name, and you’ll see a list of all those tables below that.
How to create and set up a Database.
You can close both phpMyAdmin and cPanel and go on installing your script.
follow Step 3 in the next tutorial.

Step 3: Configuring the script with the database details

Instructions on where and how to add your database info to the script’s configuration file should be described in your script installation guide, since this is different for each and every script.
Basically, your configuration file will contain this piece of code (or a variation):
How to create and set up a Database.
After adding your database info, this is how it will look like:
How to create and set up a Database.
Upload the customzed file to your server.
Your Done!

0 komentar:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Translate

Subscribe Here

Enter your email address:

Like Facebook

Online Chat Comment

Reference

Stats and info

Top Referrer