You need to give a valid username. For example, to run a query with user root you need to type the following command and then enter the password when prompted:
mysql -u root -p
When you get connected, the prompt will be looking like:
mysql>
Then here you can write your query, after the database selection, for example:
mysql> USE your_database;
mysql> SELECT * FROM your_table;
Become a SQL expert with this complete SQL Training Course!