The solution to the Chinese garbled problem of mysql csv is to select the encoding method of "10008 (MAC-Simplified Chinese GB 2312)" or the encoding of "10008 (MAC-Simplified Chinese GB 2312)" when importing the csv file method.
The operating environment of this tutorial: Windows 10 system, mysql version 5.7, Dell G3 computer.
How to solve the problem of Chinese garbled characters in mysql csv?
When MySQL imports CSV files, the problem of Chinese garbled characters appears and its solution
When using the Navicat tool to import a .csv
file containing Chinese fields into the local database, the garbled code as shown below appears. .
After my verification, it is not a database fieldDesign
problem. So I guess it has something to do with the encoding when importing. The following 65001utf-8
I thought there was no problem at first, but the problem appears here!
Select the encoding method of 10008 (MAC-Simplified Chinese GB 2312) when importing!
Encoding is particularly important. You must choose 10008 (MAC-Simplified Chinese GB 2312). You cannot use the default utf-8, because CSV files containing Chinese are generally Use 10008 encoding instead of utf8
.
Successfully solved!
Wrong way:
If the encoding is incorrect, garbled characters will appear! ! !
Test if you use text to import and use the utf-8
encoding method to import, will there be garbled characters? , and it turns out that garbled characters will also appear when importing!
Select the encoding method of 10008 (MAC-Simplified Chinese GB 2312) when importing! This problem can also be solved.
Summary: The imported data is garbled, which is most likely a problem with the encoding method.
Recommended learning: "MySQL Video Tutorial"
The above is the detailed content of How to solve the problem of Chinese garbled characters in mysql csv. For more information, please follow other related articles on the PHP Chinese website!