mysql中like’中国‘查询不出来结果 如果 like‘zg’就看查询出来结果。
查询了半天是由于mysql中编码的原因
解决办法:
进入mysql 输入命令:show variables like 'character_set_%';
查看字符集设置
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
修改命令为:SET character_set_database = utf8 ; (如果除filesystem外其他的value值不为utf8 也一律这样修改)。