Connecting to MySQL database from the command line?



To connect MySQL from the command line, firstly open command prompt. You can do this with the help of shortcut key β€œWindows + R”. On clicking, a panel will open and you need to type CMD and need to press OK button as shown below βˆ’

After pressing the OK button, you will get command line window.

Reach the MySQL Server β€œbin” directory as shown in the following screenshot βˆ’

Now you have reached the bin directory. Type the following statement in order to connect with MySQL.

mysql -u yourUserName -p

Apply the above statement to connect with MySQL. The snapshot is as follows with username β€œManish” and password βˆ’

Updated on: 2019-07-30T22:30:24+05:30

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements