Home  >  Article  >  Database  >  What should I do if mysql comments are garbled in Chinese?

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

藏色散人
藏色散人Original
2020-10-27 10:17:534167browse

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 的注释为乱码

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;

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!

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