This document summarizes the commands for viewing the MySQL character set. Commands include viewing MySQL database server Character Set, viewing MySQL database character set, character set of data tables and fields, and Character Set supported by currently installed MySQL, linux is applicable.
1. view the MySQL database server and database character set.
Mysql> show variables like '% char % ';
+ -------------------------- + ------------------------------------- + ------
| Variable_name | Value | ......
+ -------------------------- + ------------------------------------- + ------
| Character_set_client | utf8 |... -- client Character Set
| Character_set_connection | utf8 | ......
| Character_set_database | utf8 | ...... -- database Character Set
| Character_set_filesystem | binary | ......
| Character_set_results | utf8 | ......
| Character_set_server | utf8 | ...... -- server Character Set
| Character_set_system | utf8 | ......
| Character_sets_dir | D: \ MySQL Server 5.0 \ share \ charsets \ | ......
+ -------------------------- + ------------------------------------- + ------
2. view the character set of the MySQL DATA table.
Mysql> show table status from sqlstudy_db like '% countries % ';
+ ----------- + -------- + --------- + ------------ + ------ + ----------------- + ------
| Name | Engine | Version | Row_format | Rows | Collation | ......
+ ----------- + -------- + --------- + ------------ + ------ + ----------------- + ------
| Countries | InnoDB | 10 | Compact | 11 | utf8_general_ci | ......
+ ----------- + -------- + --------- + ------------ + ------ + ----------------- + ------
3. view the character set of the MySQL DATA column.
Mysql> show full columns from countries;
+ ---------------------- + ------------- + ----------------- + --------
| Field | Type | Collation | .......
+ ---------------------- + ------------- + ----------------- + --------
| Countries_id | int (11) | NULL | .......
| Countries_name | varchar (64) | utf8_general_ci | .......
| Countries_iso_code_2 | char (2) | utf8_general_ci | .......
| Countries_iso_code_3 | char (3) | utf8_general_ci | .......
| Address_format_id | int (11) | NULL | .......
+ ---------------------- + ------------- + ----------------- + --------
4. view the character sets supported by currently installed MySQL.
Mysql> show charset;
+ ---------- + ----------------------------- + --------------------- + -------- +
| Charset | Description | Default collation | Maxlen |
+ ---------- + ----------------------------- + --------------------- + -------- +
| Big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 |
| Dec8 | DEC West European | dec8_swedish_ci | 1 |
| Cp850 | DOS West European | cp850_general_ci | 1 |
... N rows are omitted here.
+ ---------- + ----------------------------- + --------------------- + -------- +
Articles you may be interested in
- How to modify the character set of a mysql database
- Summarize the causes and solutions for the slow MySQL Database Server
- Steps for synchronizing and backing up mysql Databases in windows
- Navicat for mysql remote connection to the mySql database prompt 10061,1045 error Solution
- How to forget the MySQL Database Password of PHPnow
- Rational use of MySQL database indexes to make the database run efficiently
- Mysql database cache function analysis, debugging, and performance summary
- Mysql Server master-slave Database Synchronization Configuration