LoginSignup
0
1

More than 5 years have passed since last update.

なんかInsert出来ない

Last updated at Posted at 2016-03-15

AmazonLinuxにmysqldのプロセス立てて、RailsからInsertしようとしたら

FATAL -- :
ActiveRecord::StatementInvalid
(Mysql2::Error: Incorrect string value:
'\xE3\x83\x86\xE3\x82\xB9...' 
for column 'title' at row 1:
INSERT INTO `tabale_names`
(`title`, `created_at`, `updated_at`)
VALUES ('テスト','2016-03-15 18:40:43', '2016-03-15 18:40:43')):

みたいに出たので解決してみた。

原因はamazonLinuxに入ってたmysqlの設定まわりの問題。
文字コードがutf-8になってないから 'テスト' のところで落ちていた模様。

(mysqlに入って直接Insert文流したら文字化けしてInsertされてた)

あとは

こちらを参考に設定を変更

でもう一度unicorn再起動して、問題ないことを確認できた。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1