char
成都创新互联公司是一家朝气蓬勃的网站建设公司。公司专注于为企业提供信息化建设解决方案。从事网站开发,网站制作,网站设计,网站模板,微信公众号开发,软件开发,
小程序设计,10年建站对
茶艺设计等多个方面,拥有丰富设计经验。acter_set_client 在客户端发出SQL语句所使用的字符集。
collation_connection 连接所使用的字符集校对规则
character_set_results 返回到客户端的查询结果集(例如查询结果或错误信息)所使用的字符集
character_set_connection The character set used for literals that do not have a character set introducer and for number-to-string conversion
--指定客户端当前会话使用的字符集 SET NAMES会同时更改character_set_client, character_set_connection,character_set_results这三个会话参数的字符集
mysql>
set names utf8; Query OK, 0 rows affected (0.00 sec)
mysql> show variables like '%character%';
+--------------------------+-----------------------+
| Variable_name | Value |
+--------------------------+-----------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | gbk |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | gbk |
| character_set_system | utf8 |
| character_sets_dir | /data/share/charsets/ |
+--------------------------+-----------------------+
8 rows in set (0.00 sec)
SET CHARACTER SET会更改character_set_client、character_set_results,同时将character_set_connection设置为character_set_database这个系统参数的值
mysql>
set character set latin2; Query OK, 0 rows affected (0.01 sec)
mysql> show variables like '%character%';
+--------------------------+-----------------------+
| Variable_name | Value |
+--------------------------+-----------------------+
| character_set_client | latin2 |
| character_set_connection | gbk |
| character_set_database | gbk |
| character_set_filesystem | binary |
| character_set_results | latin2 |
| character_set_server | gbk |
| character_set_system | utf8 |
| character_sets_dir | /data/share/charsets/ |
+--------------------------+-----------------------+
8 rows in set (0.00 sec)
本文标题:MySQL5.5客户端字符集相关参数-创新互联
本文URL:
http://cqcxhl.com/article/dgjpio.html