clowwindy的杂草牧场

   :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
mysql -u [USER_NAME] -p -e "select TABLE_NAME from information_schema.tables where table_schema='DATABASE_NAME' and engine='MyISAM';" | tail -n +2 | xargs -I '{}' echo "ALTER TABLE {} ENGINE=INNODB;" > alter_table.sql
perl -p -i -e 's/(search_[a-z_]+ ENGINE=)INNODB/\1MYISAM/g' alter_table.sql
mysql -u [USER_NAME] -p [DATABASE_NAME] < alter_table.sql

修改自:

http://highervisibilitywebsites.com/convert-your-mysql-database-myisam-innodb-and-get-ready-drupal-7-same-time

posted on 2011-09-27 09:46  clowwindy  阅读(1106)  评论(0编辑  收藏  举报