Step 1: How to create and set up a Database

This entry is part 1 of 3 in the series MySQL Database Tutorials

Intro

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.


MySQL Database Tutorials

  1. Step 1: How to create and set up a Database
  2. Step 2:Importing Your Database Tables
  3. Step 3: Configuring the script with the database details
Series NavigationStep 2:Importing Your Database Tables»
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • StumbleUpon
  • Technorati

Tags:
Posted in MySQL Database Tutorials | No Comments »

Post a Comment