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