Skip to content

Instantly share code, notes, and snippets.

@ofus
Created March 31, 2012 05:05
Show Gist options
  • Save ofus/2259518 to your computer and use it in GitHub Desktop.
Save ofus/2259518 to your computer and use it in GitHub Desktop.
Convert MyISAM tables to InnoDB
mysql -p -e "show tables in $DATABASE_NAME;" | tail --lines=+2 | xargs -i echo "ALTER TABLE {} ENGINE=INNODB;" > /tmp/alter_table.$DATABASE_NAME.sql
mysql --database=$DATABASE_NAME -p < /tmp/alter_table.$DATABASE_NAME.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment