How to view MySQL database character sets

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.