Home > Database > Mysql Tutorial > body text

What should I do if mysql comments are garbled in Chinese?

藏色散人
Release: 2020-10-29 16:51:48
Original
4279 people have browsed it

The solution to the problem that mysql comments are garbled Chinese characters: first use the "show variables like" command to check the character set settings of the database and server; then execute the statement "set collation_server=utf8_general_ci;".

What should I do if mysql comments are garbled in Chinese?

Recommendation: "mysql video tutorial"

mysql table comment garbled code

Question

Execute statement: alter table TABLE_XXX comment '中文号';

Result: use information_schema;

select * from TABLES where TABLE_SCHEMA=’mydb’ and TABLE_NAME=’TABLE_XXX’
TABLE_XXX 的注释为乱码
Copy after login

Check System

Use show variables like “%colla%”; show varables like “%char%”; these two commands to view the character set settings of the database and server

Modify

set collation_server=utf8_general_ci;
set collation_connection=utf8_general_ci;
Copy after login

The above is the detailed content of What should I do if mysql comments are garbled in Chinese?. 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