Mysql2::Error: Incorrect string value

后端 未结 7 1460
青春惊慌失措
青春惊慌失措 2021-01-29 23:30

I have a rails application running on production mode, but all of the sudden this error came up today when a user tried to save a record.



        
7条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-30 00:04

    Need to change CHARACTER SET and COLLATE for already created database:

    ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci;
    

    Or it was necessary to create a database with pre-set parameters:

    CREATE DATABASE databasename CHARACTER SET utf8 COLLATE utf8_general_ci;
    

提交回复
热议问题