Home > Database > phpMyAdmin > body text

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

angryTom
Release: 2020-03-11 13:12:08
Original
2486 people have browsed it

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;
Copy after login

[2] Change the character encoding of the database

ALTER DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template