How to view the three MySQL character sets

Source: Internet
Author: User

The MySQL character set is diverse. The following lists three of the most common ways to view MySQL character sets. This method is for your reference. I hope you can learn about MySQL databases.

1. view the MySQL database server and MySQL character set.

 
 
  1. Mysql> show variables like '% char % ';
  2. + -------------------------- + ------------------------------------- + ------
  3. | Variable_name | Value | ......
  4. + -------------------------- + ------------------------------------- + ------
  5. | Character_set_client | utf8 |... -- client Character Set
  6. | Character_set_connection | utf8 | ......
  7. | Character_set_database | utf8 | ...... -- database Character Set
  8. | Character_set_filesystem | binary | ......
  9. | Character_set_results | utf8 | ......
  10. | Character_set_server | utf8 | ...... -- server Character Set
  11. | Character_set_system | utf8 | ......
  12. | Character_sets_dir | D: \ MySQL Server 5.0 \ share \ charsets \ | ......
  13. + -------------------------- + ------------------------------------- + ------

2. view the MySQL Character Set of the MySQL DATA table.

 
 
  1. mysql> show table status from sqlstudy_db like '%countries%';  
  2. +-----------+--------+---------+------------+------+-----------------+------  
  3. | Name      | Engine | Version | Row_format | Rows | Collation       |......  
  4. +-----------+--------+---------+------------+------+-----------------+------  
  5. | countries | InnoDB |      10 | Compact    |   11 | utf8_general_ci |......  
  6. +-----------+--------+---------+------------+------+-----------------+------ 

3. view the MySQL Character Set of the MySQL DATA column.

 
 
  1. mysql> show full columns from countries;  
  2. +----------------------+-------------+-----------------+--------  
  3. | Field                | Type        | Collation       | .......  
  4. +----------------------+-------------+-----------------+--------  
  5. | countries_id         | int(11)     | NULL            | .......  
  6. | countries_name       | varchar(64) | utf8_general_ci | .......  
  7. | countries_iso_code_2 | char(2)     | utf8_general_ci | .......  
  8. | countries_iso_code_3 | char(3)     | utf8_general_ci | .......  
  9. | address_format_id    | int(11)     | NULL            | .......  
  10. +----------------------+-------------+-----------------+--------  
  11.  

How to modify the default Character Set of mysql

Role of MySQL Foreign keys in Databases

How MySQL defines foreign keys

MySQL foreign key syntax

MySql stored procedure with Parameters

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.