At the MySQL Performance Blog, the good writer took time out recently to show us his script to convert tables to InnoDB. Recently, I also had to convert a large quantity of MyISAM tables (come on! you're better off with SQLite if you're going to use MyISAM for an application) to InnoDB. My approach used, not the fine tools from Maatkit, but good old Bash in conjunction with the MySQL command line client:


#!/bin/bash
echo 'show tables' | mysql -uroot -ppassword $1 | sed "/^Tables_in_$1$/D" | awk '{ print "alter table " $0 " engine=innodb;" }'

Naturally, root's password would not be password and, if you are on a server hosted/administered by someone else, you would not want
to leave the password in the shell's history, but you get the idea. The advantage: on a Linux box running MySQL, you can depend on
bash, the mysql client, sed and awk being installed a lot more than Maatkit.