If you've forgotten or are not sure which database is the current one which can happen easily if you're using multiple databases and switching between them several times use the following statement:
SELECT DATABASE();
DATABASE( ) is a function that returns the name of the current database. If there are no active database selected then this function will return NULL.
The STATUS command (and its synonym, \s) will also display the current database name along with the additional information:
Please let me know if this piece of information was useful. Happy reading..!!
SELECT DATABASE();
DATABASE( ) is a function that returns the name of the current database. If there are no active database selected then this function will return NULL.
The STATUS command (and its synonym, \s) will also display the current database name along with the additional information:
Please let me know if this piece of information was useful. Happy reading..!!
Technorati Tags: Current Database,Find Selected Database,SQL Database,MySQL Database,Select Database
del.icio.us Tags: Current Database,Find Selected Database,SQL Database,MySQL Database,Select Database
How to find the Current Database?
Reviewed by Suntaragali The Smart Techie
on
January 01, 2013
Rating:
No comments: