How To DROP DATABASE LIKE In MySQL
erics, January 21st, 2020
1 |
echo `mysql -uyourUser -pyourPassword -B --disable-column-names -e "SELECT CONCAT('DROP DATABASE ', SCHEMA_NAME, ';') FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME LIKE 'yourPrefix%';"` | mysql -uyourUser -pyourPassword -B |