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
To search for RocketMQ images, you can search on ...
In previous blog posts, I have been focusing on so...
The installation process is basically the same as...
<br />For every ten thousand people who answ...
This article shares with you the graphic tutorial...
Say it in advance Nodejs reads the database as an...
Based on past experience, taking notes after comp...
Table of contents 1. Why use slots? 1.1 slot 1.2 ...
1. Shut down the mysql service # service mysqld s...
1. Install Docker on the server yum install docke...
When developing a project, you will often encount...
CPU Load and CPU Utilization Both of these can re...
The first time I installed MySQL on my virtual ma...
Table of contents 2. Field concatenation 2. Give ...
Due to work reasons, it is often not possible to ...