Home >Database >Mysql Tutorial >Solution to the problem of importing Chinese garbled characters into mysql database
What should I do if the Chinese characters in mysql database are garbled? How to solve the problem of Chinese garbled characters after importing mysql data? How to deal with it? In the past two days, I used a data CSV file containing Chinese fields in the project. I used workbench to import the file and reported an error:
I searched for it online for a long time and all said it was. The CSV file encoding does not match the client encoding. Try converting the CSV to utf8 encoding, but the import still does not work.
Finally use the Navicat tool to complete the import:
##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 generally use the 10008 encoding method. Not utf8.
Error method:
If the encoding is incorrect, garbled characters will appear! ! !
At this point, the mysql data import work is completed!
So far, the problem of Chinese garbled characters in the mysql database has been completely solved! [Related article recommendations]mysql database Chinese garbled solution_MySQL
##MySQL database table garbled solution_MySQL[Related video course recommendations]
Garbled code problem-Six days to take you through the MySQL video tutorialThe ultimate solution to garbled data display Method - PHP introductory video tutorial one, learn PHP in one weekThe above is the detailed content of Solution to the problem of importing Chinese garbled characters into mysql database. For more information, please follow other related articles on the PHP Chinese website!