Mysql - Mysql2::Error: Incorrect string value:

后端 未结 3 1225
说谎
说谎 2021-02-03 12:12

So I built a scraper and am pulling in some objects. The issue is some are foreign languages and it is tripping the mysql db up a bit. This is the error I got. Any idea what I c

3条回答
  •  我在风中等你
    2021-02-03 13:08

    You can find the answer here. I am not sure how to report duplicate. Mysql2::Error: Incorrect string value Rails 3 UTF8

    For your convenience, let me reiterate my answer


    I had encountered this issue recently. It's essentially mysql default collation type is not utf8_unicode_ci.

    Do the following. Backup your data if you have to. I had to drop the database and recreate it

    rake db:drop
    rake db:create
    

    Change mysql database collation to utf8_unicode_ci ( phpMyAdmin might come in handy here) Finally, restore your migration.

    rake db:migrate
    

    Enjoy.

提交回复
热议问题