Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

  • Advertisements

How to use/connect database from mysql command prompt

Posted by Pankil Patel on May 17, 2012

Note: Please make sure that you have checked the command prompt feature during mysql installation.

Step 1: type “cmd” into your run window of your OS

Step 2: type below command into your cmd terminal

>mysql -h localhost -u root -p

it will ask for passwod like below

Enter password: ****

you need to give password and after that press enter key.

Step 3: now it will give mysql> terminal initial, When you see mysql> it means from a MySQL prompt after successful logging into MySQL using “localhost” as a host and “root” as a user.

Step 4: Now perform any database commands into your database by creating / selecting your database.


mysql> create database mytest;
Query OK, 1 row affected (0.00 sec)

mysql> use mytest;
Database changed


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: