window:
在安装的时候,mysql安装步骤要记得更改语言,默认为latin,一般更换为Utf8,如果这步操作你没有更改的话,那你就要找到php.ini文件进行设置:
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
关闭mysql Client ,停止mysql服务,(服务里面可以找到),重新启动:
在Client打:
show variables like 'character%';
mysql> show variables like 'character%';
+--------------------------+------------------------------+
| Variable_name | Value |
+--------------------------+------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | D:\AMP\mysql\share\charsets\ |
+--------------------------+------------------------------+
8 rows in set (0.08 sec)
linux下面的编码方式本来就是utf8;
开启远程访问,只需要把
#bind-address="127.0.0.1" 注释掉就可以了,重启服务