Home  >  Article  >  Database  >  How to query encoding in mysql

How to query encoding in mysql

青灯夜游
青灯夜游Original
2021-12-13 18:19:506879browse

Query method: 1. Use the "show variables like 'character%'" command to query the encoding of the entire library; 2. Use the "show table status from table name like "%yxfx_zxxx_fyb%"" command to query Query the specified table code.

How to query encoding in mysql

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

mysql query encoding

Method 1: Query the encoding of the entire library

show variables like 'character%'

How to query encoding in mysql

Among them,

  • character_set_client is the client encoding method;

  • ##character_set_connection is the encoding used to establish the connection;

  • character_set_database database encoding;

  • character_set_results result set encoding;

  • character_set_server database server encoding ;

As long as the above four encoding methods are the same, there will be no garbled code problem.

Method 2: Query the encoding of the specified table

Use the following command:

show table status from 表名 like "%yxfx_zxxx_fyb%"

[Related recommendations:

mysql video tutorial

The above is the detailed content of How to query encoding in mysql. 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