mySQL check which database is in use code example
Example 1: mysql get db name
SELECT DATABASE();
Example 2: how to show current database in mysql
CopySELECT database();
Example 3: check if mysql db is used
SELECT UNIX_TIMESTAMP(MAX(UPDATE_TIME)) as last_update FROM information_schema.tables WHERE TABLE_SCHEMA='replace-with-database-name' GROUP BY TABLE_SCHEMA;