MySQL5.0中文问题解决方案如下(每次都要设置):
1、在dos环境下,用mysql --default-character-set=utf8 -uroot -p 这句话进入mysql
2、mysql> show variables like 'character\_set\_%';
+--------------------------+--------+
| 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 |
+--------------------------+--------+
7 rows in set (0.00 sec)
3、再执行如下命令
mysql> set character_set_results=gbk;
mysql> set character_set_client=gbk;
还有一种方案: 在登录时,直接使用如下命令登录就可以了
mysql --default-character-set=gbk -uroot -p