I need to check if a database is totally empty (no tables) using an SQL query. How can this be done?
Thanks for the help!
In bash:
db_name='my_db' mysql -s --skip-column-names -e "SELECT COUNT(DISTINCT table_name) FROM information_schema.columns WHERE table_schema = '$db_name'"