The reason for the error in checking MySQL 1366

Source: Internet
Author: User

Find some interesting answers when checking for the wrong reason for MySQL 1366.

However, someone has given a better solution.

    1. The MySQL 1366 error is roughly described below
    2. 1. SQL Error:1366:incorrect String value: "\xe8\xaf\xa6\xe7\xbb\x86 ..." for column ' address ' at row 1
    3. Workaround: Check the database the character set of this field is the same as the character set of the SQL statement passing data, and a MySQL1366 error is thrown.
    4. Modify the character set and collation rules for this field in MySQL. Assuming the data table is Phplamp, the character set of the SQL statement is UTF8 and the error field is address:
    5. MySQL 1366 Error Resolution
    6. 1. #检查数据表所有字段的状态
    7. 2.->show full columns from Phplamp;
    8. 3. #发现address字段的Collation项非utf8, modify it!
    9. 4.->alter table phplamp change name name varchar (+) Character Set UTF8 collate utf8_unicode_ci NOT NULL default  ‘‘;
    10. Once you have modified the character set for the field, you can use the show full columns from table_name command to check again to ensure that it is foolproof. If your SQL character set is GBK or GB2312 or otherwise, you only need to change the character set of the table field to its corresponding encoding.
    11. To send another MySQL command:
    12. Modify the character set and collation of a data table

The reason for the error in checking MySQL 1366

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.