Skip to content

Instantly share code, notes, and snippets.

@vinaghost
Last active July 25, 2024 11:11
Show Gist options
  • Select an option

  • Save vinaghost/c24e1f44d990910cf7144045ac9d823d to your computer and use it in GitHub Desktop.

Select an option

Save vinaghost/c24e1f44d990910cf7144045ac9d823d to your computer and use it in GitHub Desktop.
drop database
select CONCAT('drop database `', schema_name,'`;') as database_name from information_schema.schemata where schema_name like '%DATABASES_TO_REMOVE%' order by schema_name;
select CONCAT('echo "Importing: ', schema_name,'"\nmysql -u USERNAME -pPASSWORD ', schema_name,' < villagecrawler_migration.sql\nwait\n') as database_name from information_schema.schemata where schema_name like '%DATABASES_TO_IMPORT%' order by schema_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment