Home >Database >phpMyAdmin >What should I do if phpMyAdmin imports csv with Chinese garbled characters?
What should I do if phpMyAdmin imports csv with Chinese garbled characters?
The data CSV file containing Chinese fields is used in the project, and Chinese content is found in the imported Mysql data. Garbled characters.
Analysis reason: Caused by database character encoding problem.
The solution is as follows:
[1] Create a utf-8 character set database
CREATE DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
[2] Change the character encoding of the database
ALTER DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
As above, it is normal after changing the character encoding of the data.
For more phpmyadmin related technical articles, please visit the phpmyadmin usage tutorial column!
The above is the detailed content of What should I do if phpMyAdmin imports csv with Chinese garbled characters?. For more information, please follow other related articles on the PHP Chinese website!