Connect to SQL from command prompt in Windows

After installing the Xampp for Windows, you  can use command prompt for practicing SQL on your desktop.
These are the following steps for using command prompt in order to do SQL practice.

1. Firstly, go to Start tab from your desktop and type in command prompt in the search box.

 

command%2Bprompt1

 

2. In command prompt, type in following path as mentioned below.
( Note: Xampp  should be installed and services must be started specially Mysql from its control panel ‘go there’).
  
C:\Users\Sandeep>cd/     /* ‘cd/’ is used to go to the root directory */
C:\>cd xampp             /* ‘cd’ is used to change the path */
C:\xampp>cd mysql        
C:\xampp\mysql>cd bin    / These commands simply represent ‘C:xamppmysqlbin’ */

command%2Bprompt


3. Now, you need to specify your MySQL username  which is usually root  and there password don’t required .

C:\xmapp\mysql\bin>mysql -u root -p

command%2Bpromp2t


4. Now you are in MySQL.

command%2Bprompt3





Leave a Reply