How do I log on to MySQL?
Author: Deron Eriksson
Description: This tutorial describes how to log on to MySQL.
Tutorial created using: Windows XP || MySQL 5.0.27


After installing MySQLW, if you open a command prompt and type 'mysql' and you receive a message such as "'mysql' is not recognized as an internal or external command, operable program or batch file," you most likely need to add your MySQL bin directory to your System Path.

If you type just 'mysql' at the command prompt and the mysqlW bin directory is in your System Path, you will probably receive an error such as the one below at the first prompt. This is because mysql would like to know the user and the databaseW (host) that you would like to connect to. To supply this information, you can type '-h' followed by the host to connect to, and '-u' followed by the user name to connect with. You also should enter '-p' to indicate that you would like to supply a password, which you can either enter following the '-p' or at the prompt, as shown below.

executing 'mysql -u root -p -h localhost' at command prompt