Mysql drop all databases


Here is a quick mysql script to drop all databases except test and information schema :

Go to mysql command-line and execute this :

1
select group_concat(concat(‘drop database `’,SCHEMA_NAME,’`;’) SEPARATOR ‘ ‘ ) from information_schema.schemata where SCHEMA_NAME !=’mysql’ and SCHEMA_NAME !=’information_schema’;

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.