How to show the current database in MySql

Problem

You connect to the MySql server from the shell and after switching between some databases you forget which database is selected.

Solution

mysql> SELECT DATABASE();

If no database is selected, the query will return null.

References

Join the ConversationLeave a reply

Your email address will not be published. Required fields are marked *

Comment*

Name*

Website