MySQL Insert Chinese data error

Source: Internet
Author: User
Tags mysql insert

The following error occurs when inserting Chinese in the operations database:

ERROR 1366 (HY000): Incorrect string value: ' \xc4\xe3\xba\xc3 ' for column ' username ' at row 1

Solution:

View the encoding settings for the current database in cmd: Server, Db, Client, Conn the respective encoding is set as follows

    

  If the client and the Conn code is not the platform code will appear in Chinese garbled situation received an error. Modify the my.ini file under the MySQL installation file .

  

Note: In the 5.1 version of MySQL [MySQL] and [mysqld] are written Default-character-set=utf8

After the 5.5 version of MySQL these files are automatically configured under [MySQL] under the Default-character-set=utf8 under [mysqld] is Character-set-server=utf8

MySQL Insert Chinese data error

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.