無料期間が終わるAWSから古いVPSにRailsプロジェクトを退避する作業をしていた。

$  RAILS_ENV=production rake db:create
Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
#<Mysql2::Error: Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/)>
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8mb4", "collation"=>"utf8mb4_general_ci", "pool"=>5, "userna
me"=>"user", "password"=>"pass", "socket"=>"/var/lib/mysql/mysql.sock", "database"=>"example_production", "host"=>ni
l}, {:charset=>"utf8mb4", :collation=>"utf8mb4_general_ci"}

utf8mb4が使えない…。
MySQLを5.1から5.5にあげて、mysql2 gemを入れなおしたら行けた。

$ sudo yum upgrade mysql --enablerepo=remi
$ bundle exec gem uninstall mysql2
$ bundle