SQLSTATE[HY000]: General error: 1366 Incorrect string value: ‘\xF0\x9F\x98\x8A\xF0\x9F…’ 解决

Reason
The culprit is the emoji in the tweets. Some of the emojis have four bytes UTF-8 character.

The MYSQL's character set named UTF8 uses a maximum of three bytes per character and contains only BMP characters. As of MySQL 5.5.3, the UTF8MB4 character set uses a maximum of four bytes per character supports. http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html

继续阅读