I want to drop all the databases starting with a word.
abc xyz cms_db1 cms_db2 cms_xyz pqr
In the example given above, I will like to drop all
A Linux way:
for db_name in $(mysql -u USER -pPASS -e "show databases like 'cms_%'" -ss) do mysql -u USER -pPASS -e "drop database ${db_name}"; done