in reply to How to find MySQL database exist or not
Query MySQL's internal tables for the information:
1) macbookpoe:~% mysql -BN -e 'select count(1) from information_schema +.TABLES where TABLE_SCHEMA="test" and TABLE_NAME="moo"' 1 1) macbookpoe:~% mysql -BN -e 'select count(1) from information_schema +.TABLES where TABLE_SCHEMA="test" and TABLE_NAME="moue"' 0
|
|---|