Home  >  Article  >  Database  >  What should I do if phpMyAdmin imports csv with Chinese garbled characters?

What should I do if phpMyAdmin imports csv with Chinese garbled characters?

angryTom
angryTomOriginal
2020-03-11 13:12:082421browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn