Steps to connect to MySQL on Windows Command Line
To connect to MySQL database on Windows through Command line, there are some steps to be followed.
1. You need to start the MySQL service, you can go to Start->Control Panel->System and Securities->Administrative Tools->Component Service->Services(local), then on the right panel, you can find one service name called MySQL and you should start this service
2. Go the the MySQL installation folder, which is something like this : C:\Program Files\MySQL\MySQL Server 5.1. In this folder, find the bin folder.
3. Open a command console and change the working directory to C:\Program Files\MySQL\MySQL Server 5.1\bin (You may change this according to you MySQL installation folder). And then type mysqld to start the MySQL server. You can check the status of the mysql server by start the task manager to check whether the mysqld process is present or you can type mysqladmin -u <username> -p <password> version to check whether it works or not.
4. Next you need to start the mysql client, which is the mysql.exe file in the same folder as the mysqld.exe. On the same command console, type mysql -u <username> -p <password> to connect to the server.
5. If the connection is successful, the mysql> prompt will show up. If the connection fails, you may check whether you type the correct username and password.
6 After successful connection, you can type SHOW DATABASES; to check the databases on the MySQL server.
That's all. If you still have confusions, please feel free to leave a message below or send me an email through email@example.com