查看编码
show variables like 'char%';
结果
+--------------------------+--------+ | 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_set_results 编码为gbk
要和DB存储编码一致,这里改成utf8
set character_set_results=utf8;