MySQL login FAQ: How do I log into a MySQL database?
Assuming you have the root password, this MySQL command from your Unix/Linux command line will work:
mysql -u root -p
After issuing that MySQL login command you will be prompted for the root user password. Just enter that root password, and you should be in. After you login, your console should look like this (using MySQL version 5):
C:\>mysql -u root -p Enter password: ******** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to server version: 5.0.18-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>