SHOW VARIABLES LIKE ‘%char%’;
SHOW VARIABLES LIKE ‘%coll%’;
SET NAMES ‘utf8’;
其中
SET NAMES ‘utf8’;
等价于以下3条SQL语句
SET character_set_client = utf8;
SET character_set_results = utf8;
SET character_set_connection = utf8;
这3个变量的作用:
信息输入路径:client→connection→server;
信息输出路径:server→connection→results。