Skip to content

Instantly share code, notes, and snippets.

@akiko-pusu
Created March 4, 2013 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akiko-pusu/5079900 to your computer and use it in GitHub Desktop.
Save akiko-pusu/5079900 to your computer and use it in GitHub Desktop.
MySQLのデータベースのエンジンを変更する ALTER Tableを書き出すスクリプトを作る(長っ!) 下記はInnoDBに変更。MyISAMかINNODBかは任意で。
mysql -uuser -p -e "show tables in ターゲットのDB名" | tail --lines=+2 | xargs -i echo "ALTER TABLE {} ENGINE=INNODB;" > alter_table.sql
@akiko-pusu
Copy link
Author

mysql -uユーザ名 -p データベース名 < alter_table.sql  で変換。(バックアップ取りましょう...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment