MySQL Learning note four: Character set

Source: Internet
Author: User

1. A character set is a collection of characters and their encodings to see the character sets supported by the database

character Set

2. View the default character set when the server starts

Mysql>Show variables like 'character_set_%';+--------------------------+-------------------------------------------+|Variable_name|Value|+--------------------------+-------------------------------------------+|Character_set_client|Gbk||Character_set_connection|Gbk||Character_set_database|Utf8||Character_set_filesystem| binary                                    ||Character_set_results|Gbk||Character_set_server|Utf8||Character_set_system|Utf8||Character_sets_dir|D:\MySQL\MySQL Server5.5\share\charsets\|+--------------------------+-------------------------------------------+

3. Set the current client session character set

set names UTF8 or set character set ' Charset_name '

4. Specify the character set when saving

Create  db student Charser gb2312  -----Database-level granularity-------createtable db_name (....) Engine=default charset=UTF8-----  table-level granularity-------Col_ Namecharacterset UTF8   -----column-level granularity------

5. Setting the default character set for global granularity

set global character_set_server=UTF8

MySQL Learning note four: Character set

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.