Home  >  Article  >  Database  >  Solve the problem of Chinese garbled characters written to mysql

Solve the problem of Chinese garbled characters written to mysql

王林
王林forward
2020-01-27 21:11:092847browse

Solve the problem of Chinese garbled characters written to mysql

The question leads to:

When writing data to the mysql database from another system, I found that the Chinese text changed to ?????.

The solution is as follows:

First check the database settings. The corresponding character set of the server is latinl

Solve the problem of Chinese garbled characters written to mysql

Recommended related learning video tutorials:mysql video tutorial

Adjust mysql parameter configuration, configuration file directory /etc/mysql/mysql.conf.d/

Add a line: character-set-server = utf8

Solve the problem of Chinese garbled characters written to mysql

Then restart the mysql service, check the server parameter configuration again, and rewrite Chinese to normal.

Solve the problem of Chinese garbled characters written to mysql

Recommended related articles and tutorials: mysql tutorial

The above is the detailed content of Solve the problem of Chinese garbled characters written to mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete