How do you deselect MySQL database?

Bruce Daniels presented an answer at https://web.archive.org/web/20160130220207/https://dev.mysql.com/doc/refman/5.5/en/use.html.

It goes like:

CREATE DATABASE foofoofooweird;
USE foofoofooweird;
DROP DATABASE foofoofooweird;

Et voila, no database is in use.

To be clear, the hack is to CREATE, USE, then DROP (delete) a temporary placeholder database.
It is NOT advocating dropping (deleting) any database you actually use!

All credits to Bruce Daniels!


There is no UNUSE. You just select another database and USE it.

Tags:

Mysql

Database