Doing a simple table query as follows, an error message is displayed directly. It turns out that the character set is inconsistent. This article records the character set type of MySQL and the solution to the following problem select a.id, b.id from tt as a, t2 as b where a.xx = b.xx -- Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation '=' 1. SolutionLet's first look at the solution to the above problem. The easiest way to think of it is to unify the character sets of the two tables, either both are utf8mb4_general_ci or both are utf8mb4_unicode_ci. This problem will be naturally solved by unifying. What if I don't want to change the character set of the table? After all, in a production environment, doing this kind of operation is still risky. Here is a less elegant solution. Specify the character set after the field (you can specify all of them as utf8mb4_general_ci or all of them as utf8mb4_unicode_ci, just process it according to your actual needs) select a.id, b.id from tt as a, t2 as b where a.xx = b.xx collate utf8mb4_general_ci 2. MySQL character set Character SetFor domestic partners, generally speaking, our common character sets are the following three
MySQL actually supports more, which can be queried through show charset; Verification rulesIn actual cases, we often see the following
Of course, we can also view the supported validation rules through show collation; Please note the above wording
This is the end of this article about how to solve the abnormality of connecting tables caused by inconsistent MySQL character sets. For more related content about abnormality of connecting tables caused by inconsistent MySQL character sets, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: A brief discussion on JavaScript scope
>>: Two special values in CSS are used to control the inherit and initial methods of the cascade
Table of contents Overview 1. Test for null value...
Using c3p0 Import the c3p0jar package <!-- htt...
1. overflow:hidden overflow hidden If overflow:hi...
How to define and use: Use the slot tag definitio...
Install Required Files Yum install openssl-* -y C...
1. Prerequisites We use the require.context metho...
This article shares with you the installation and...
Selector Grouping Suppose you want both the h2 el...
Just like code, you can add comments to tables an...
When deleting a table or a piece of data in MySQL...
Table of contents What is Docker Client-side Dock...
Table of contents 1. Overview 2. Define a simple ...
Business scenario: Use vue + element ui's el-...
1. Go to the official website to download the ins...
This article shares the installation tutorial of ...