A different character set appears when you troubleshoot MySQL linked tables

Source: Internet
Author: User

When MySQL builds tables, it sets the character set and collation of the table, usually utf8, but the character set that I used to build the table is UTF8MB4, and the collation is utf8mb4_unicode_ci. Some UTF8MB4 table default collation is Utf8mb4_general_ci, which causes an error to be reported in the case of a union operation:

Illegal mix of collations

In fact, this is a table when the collation of the table is inconsistent, this can be resolved by changing the table collation to a consistent.

But sometimes the table is already online, cannot be modified, and now it is urgent to use, can be done by the following method:

UPDATE target LEFT JOIN  COLLATE latin1_swedish_ci ) SET target.barcode = source.barcode

A red callout is used to make the collation of the query time table consistent.

Also, setting the character set Utf8mb4 can save emoji emoticons.

A different character set appears when you troubleshoot MySQL linked tables

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.