Is it possible from within a bash script to check if a mysql database exists. Depending on the result then perform another action or terminate the script?
mysqlshow will not show underscore characters '_' in the database name.
mysqlshow $DOMAIN %
https://dev.mysql.com/doc/refman/5.1/en/mysqlshow.html