Created
December 21, 2011 23:08
-
-
Save ablyler/1508126 to your computer and use it in GitHub Desktop.
Convert all MyISAM tables in all databases on a server to InnoDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for t in $(mysql --batch --column-names=false -e "select concat(TABLE_SCHEMA, '.', TABLE_NAME) from INFORMATION_SCHEMA.TABLES where ENGINE = 'MyISAM' and TABLE_TYPE = 'BASE TABLE' and TABLE_SCHEMA <> 'mysql'" mysql); do | |
mysql -e "alter table $t type=InnoDB"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment