Created
March 4, 2013 04:19
-
-
Save akiko-pusu/5079900 to your computer and use it in GitHub Desktop.
MySQLのデータベースのエンジンを変更する ALTER Tableを書き出すスクリプトを作る(長っ!)
下記はInnoDBに変更。MyISAMか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
mysql -uuser -p -e "show tables in ターゲットのDB名" | tail --lines=+2 | xargs -i echo "ALTER TABLE {} ENGINE=INNODB;" > alter_table.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mysql -uユーザ名 -p データベース名 < alter_table.sql で変換。(バックアップ取りましょう...)