Friday, March 30, 2012

Using MySql First Time

Starting MySql First Time

To start MySql go to Start->All Programs->MySql->MySql Server 5.xx->MySql Command line Client 5.xx

You will see a command prompt asking for the password.Enter root as password & press Enter Key.
Next you will be greeted with details of Mysql you have installed with the mysql prompt.
Now you are ready to use your MySql Server. You can create database & tables & all database related work

Note:- Every time you start your MySql, you have to follow the above procedure.

Closing MySql:-
We can Close MySql in three ways:-

1. By Typing exit in MySql command prompt.
2. By typing q in MySql command prompt.
3. Clicking on the cross button (x) on the right corner of MySql command window.

Now you know how to start & close your MySql. It's time to do some work on your MySql.

Things you should know before start working on MySql.


STEPS TO EXECUTE YOUR MYSQL COMMANDS:-

1. Type your MYSQL command on MYSQL command prompt.
2. End the command with semicolon ;
3. Press ENTER to execute your command & see the magic of MYSQL.

Note:-MYSQL is case-sensitive.

Examples:

1. To print the current Date & Time.
Type following in MySql command prompt.

SELECT NOW();

2. To view current user details Type

SELECT USER( );

3. To view version details of your MySql Type:-

SELECT VERSION();

Note:- we can execute more than one command at a time by saperating them with comma (,).

example:-

To view current user & version details type :-

SELECT USER(), VERSION();

************************************************************************************************
To view result in vertical format type \G in end.

Example:

SELECT USER(), VERSION() \G;

No comments:

Post a Comment