MySQL ERROR 1046 (3D000): No database selected

While I was trying to view the tables in a given database, I encountered the following error:

MySQL Error Message: ERROR 1046 (3D000): No database selected

What happens is that when you connect to a MySQL server, it doesn't choose a database for you unless you explicitly specify it.