Skip to content

Instantly share code, notes, and snippets.

@Dkendal
Created June 14, 2013 22:35
Show Gist options
  • Save Dkendal/5785803 to your computer and use it in GitHub Desktop.
Save Dkendal/5785803 to your computer and use it in GitHub Desktop.
migrate mysql to innodb
DATABASE='NAME'
echo 'SHOW TABLES;' \
| mysql -u root ${DATABASE} \
| awk '!/^Tables_in_/ {print "ALTER TABLE `"$0"` ENGINE = InnoDB;"}' \
| column -t \
| mysql -u root ${DATABASE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment