エラー内容
大きなテーブルにALTER TABLEしたらメモリが足りなくて下記のエラーが出る
An error has occurred, all later migrations canceled: Mysql2::Error: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space:
対策
- RDSのインスタンスのメモリをあげる
- innodb_buffer_pool_sizeを下げる(AWSは{DBInstanceClassMemory*3/4}がデフォルトだが1/2にしても問題なし)