Translated by Google Translate

Creating Database MySQL, Beginners Guide



This is very simple tutorial how to create database in MySQL. There are two ways to create a database MySQL, there are using GUI or via query command, but before you create database in MySQL you have to download and install XAMPP. To download and install XAMPP you can follow my tutorial : Fast Way to Install XAMPP (Trusted)

After you download and install xampp, now let me show you how to create database via phpMyAdmin, but  before we starting, check your MySQL and apache services in XAMPP Control Panel :
1. Type or copy this url into your web browser : http://localhost/phpmyadmin.
Picture 1. phpMyAdmin
2. Go to tab database and create your database, for example create database db_sample.
Picture 2. Creating Database
3. After creating database, you can add the tables and fields, look at the picture below :
Picture 3. Adding the table

When adding table, you must choose the primary key. It is important for differencing one row to another row. And then you also specify the data type from one field and the value of field character and null or not null.

And this is how you should writing when you want to create database with query sql command :

Creating database :
CREATE DATABASE db_sample;

Use database :
USE db_sample;

Adding table and fields :
CREATE TABLE tblMstrCity ( 
 id varchar(2) not null primary key, 
 name varchar(30) not null, 
 note varchar(50) null, 
);

I think it's enough for this tutorial, in the next MySQL tutorial I will show you tutorial how to creating database with the better format. Why you should give the database name like db_sample or the table name like tblMstrCity. So, wait my next MySQL tutorial, and enjoy your coffee.


Read More Add your Comment 0 comments


 

©2013 @namakuherman | Developed by Herman Creative Industry