A fast break into MySQL open source database that gives fast look for the syntax, example and administration interface. 


Core Commands for MySQL:


>> Go to MySQL Path in our PC and execute the following commands:

MySQL                                                   // connect to MySQL Server and make the cursor mysql>
Show databases;                                  // show all databases in our server.
Use (DB);    ex: Show mysql;                // will change to mysql database.
Show Tables from MYSQL;                  // Show tables from specific mysql database
Show columns from USER;                   // Show records in User table in mysql DB.
select * from USER;                               // Show all information from the user table.
select USER,Password from USER;      // Show user and password columns.
Select USER,PASSWORD from USER where user='root';
                                                               // Show only users that exist with user name called ROOT.


Commands Related with Databases and Tables:

>> Create Database with name Mydb. so in DOS under MySQL\bin

Create DATABASE nameofdatabase;      // create nameofdatabase DB.
DROP DATBASE nameofdatabase;          // delete the name of database DB.
Create Table TableName ( Attributes );    // Create table with attributes in DB
DROP Table Tablename;                           // Drop table from the database.   
Insert into Tablename (no,name,gride) value (1,'Hayba',95);


Example

>> To Create Tables, Specify their attributes and Insert data through dump file.

    mysqladmin -u root create Mydb

1) Will create file called File.dump as most of php scripts do.
2) Put the SQL Command without enter key such as:

CREATE TABLE employees (  id tinyint(4) DEFAULT '0' NOT NULL AUTO_INCREMENT,  first varchar(20),  last varchar(20),  address varchar(255),  position varchar(50),  PRIMARY KEY (id),  UNIQUE id (id));
INSERT INTO employees VALUES (1,'Bob','Smith','128 Here St, Cityname','Marketing Manager');
INSERT INTO employees VALUES (2,'John','Roberts','45 There St , Townville','Telephonist');
INSERT INTO employees VALUES (3,'Brad','Johnson','1/34 Nowhere Blvd, Snowston','Doorman');

3) then use the comming command to import the data from the dump file.

     mysql -u root mydb < file.dump


- Another Example:

CREATE TABLE user ( ID INT PRIMARY KEY AUTO_INCREMENT, userid VARCHAR(100) UNIQUE NOT NULL, password VARCHAR(50) NOT NULL, confirmpassword VARCHAR(50) NOT NULL, firstname VARCHAR(50) NOT NULL, lastname VARCHAR(50) NOT NULL, email VARCHAR(100) NOT NULL, address VARCHAR(255) NOT NULL, city VARCHAR(50) NOT NULL, zip INT(15), country VARCHAR(50) NOT NULL, notes TEXT);


>> PHPMyAdmin Configuration

1- Unzip and copy the folder to the htdocs in apache server.
2- modify config.inc.php if you want to change host or user or password.
3- fire the browser with http://localhost/<pHpmyadminfolder>/index.php