Skip to content

Instantly share code, notes, and snippets.

@filviu
Created August 18, 2014 08:40
Show Gist options
  • Save filviu/e190fbf580ab3d8d70b3 to your computer and use it in GitHub Desktop.
Save filviu/e190fbf580ab3d8d70b3 to your computer and use it in GitHub Desktop.
Migrate innodb to myisam (low memory systems)
#!/bin/bash
mysql -B -N -e "SHOW DATABASES" | while read database;
do
mysql -B -N -e "SHOW TABLES" $database | while read table; \
do \
echo "+ Converting Table $table"; \
mysql -B -N -e "alter table $table engine=myisam" $database; \
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment