Reputation: 13675
What I did is navigated to the folder where the MySQL is installed:
cd /usr/local/mysql/bin/
then logged in:
$ ./mysql -u root -p
and tried to see databases available:
mysql-> show databases;
So I got this error:
ERROR 1046 (3D000): No database selected
Now that was confusing... And that happened only once. I tried to execute the same query like 30 seconds later (while I was still logged in), and I got the normal result - the list of available databases.
What caused the query failure at first attempt ? I have tried to repeat the steps, and I can't reproduce the issue anymore.
I am on OSX Sierra.
Upvotes: 0
Views: 176
Reputation: 69
I am not 100percent sure but this is a bug in older mysql servers that require to SELECT a database prior to use any other queries althogh they are"meta" queries.
Upvotes: 1