Connect to the database through the MySQL command-line client

advertisements

I am following this tutorial: http://dev.mysql.com/doc/refman/5.7/en/connecting-disconnecting.html

However when I run MySql command line client I automatically get asked for a password when I enter it I get connected automatically to a localhost database, how do I access other database's using something like the following as shown in the tutorial example?

shell> mysql -h host -u user -p
Enter password: ********


shell> mysql nameofdatabase -uusername -ppassword

You can put a space in between -u username but not between the -p and password.