Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Convert MyISAM Tables To InnoDB

## Convert ALL MyISAM tables in ALL databases to InnoDB
# This command will continue even if an individual table fails to convert.
# output is saved to convert-to-innodb.log
mysql -Bse 'SELECT CONCAT("ALTER TABLE ",table_schema,".",table_name," ENGINE=InnoDB;") FROM information_schema.tables WHERE table_schema NOT IN ("mysql","information_schema","performance_schema") AND Engine = "MyISAM";' | while read -r i; do echo $i; mysql -e "$i"; done | tee convert-to-innodb.log
Source by www.liquidweb.com #
 
PREVIOUS NEXT
Tagged: #Convert #MyISAM #Tables #To #InnoDB
ADD COMMENT
Topic
Name
5+3 =