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