"Mysql" Storage emoji table intelligence error (Incorrect string value: ' \xf0\x9f\x98\x82\xf0\x9f ... ') solution

Source: Internet
Author: User
  • Ordinary string or expression is a placeholder 3 bytes, so utf8 enough, but the mobile side of the emoji placeholder is 4 bytes, the ordinary utf8 is not enough, in order to deal with the wireless internet opportunities and challenges, to avoid the problem of emoji emoticons, involving wireless-related MySQL Database recommendations are in advance using the UTF8MB4 character set, which must be a key element in the mobile Internet industry's technology selection
  • MySQL version limit, MySQL 5.5.3 version, support UTF8 for 3 bytes, MySQL 5.5.3 after version support UTF8MB4
    • Modify the MySQL configuration file, under Windows for My.ini (Linux for my.cnf), modify the same content
    [Client]default-character-set = Utf8mb4[mysql]default-character-set = Utf8mb4[mysqld]character-set-server = Utf8mb4collation-server = Utf8mb4_unicode_ci
    • Change the corresponding field in the database to Utf8mb4_general_ci
    • Modify the URL of the connection database in the project, remove Characterencoding=utf-8, this step must be

"Mysql" Storage emoji table intelligence error (Incorrect string value: ' \xf0\x9f\x98\x82\xf0\x9f ... ') solution

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.