In this tutorial, you will learn how to connect to MySQL server using the command line.
To connect to MySQL Server, you can use following command:
$ mysql -u[username] -h[server_host] -p
Following is the sample that trying to connect to local MySQL Server:
$ mysql -u root -p
$ mysql -u root -h localhost -p
It will prompt you for the password of the user, type the password and press
You will see following output when connect to MySQL server successfully: