Solution to MySQL error 1267

Source: Internet
Author: User

Solution to MySQL error 1267

 

The MySQL 1267 error occurs every time you transfer data to a new database:

 

Error: Illegal mix of collations (latin1_swedish_ci, implicit) and (gbk_chinese_ci, coercible) for Operation '='

 

This is an Encoding Error. It is probably because two different encodings cannot be compared using '=.

 

Because the default encoding of the system itself is latin1_swedish_ci, Every time navicat for MySQL is used to transfer the database, he does not copy the database encoding and other settings together, So he directly becomes the default encoding. the change is the data or the original gbk_chinese_ci encoding, but the stored procedure uses latin1_swedish_ci, which is definitely not acceptable. therefore, the problem of changing the database encoding to gbk_chinese_ci is solved.

 

Modification in navicat for MySQL is too simple. Right-click the database attribute and select the encoding directly.

 

You can also modify the encoding using phpMyAdmin. If the database encoding is changed, you need to check the encoding of each field in the table.

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.