以下的文章主要介绍的是 MySQL5.0中文问题的实际解决方案。我们是在dos 环境之下对其进行操作,如果你对MySQL5.0中文问题相关的实际操作有兴趣的话,你就可以对以下的文章点击观看了。
1.在dos环境下,用mysql --default-character-set=utf8 -u root -p 这句话进入mysql~~
2.mysql> show variables like 'character\_set\_%';
- character_set_client utf8
- character_set_connection utf8
- character_set_database utf8
- character_set_results utf8
- character_set_server utf8
- character_set_system utf8
- mysql> set character_set_results=gbk;
- mysql> set character_set_client=gbk;
- mysql> show variables like 'character\_set\_%';
- character_set_client gbk
- character_set_connection utf8
- character_set_database utf8
- character_set_results gbk
- character_set_server utf8
- character_set_system utf8
3.建数据库、表,如下:
- mysql>create database demo;
- mysql>use demo;
- mysql>create table user ( id int(11) not null auto_increment primary key,
- name varchar(100) not Null , age int)type=MyISAM,default character set utf8;
- insert into user(name,age) values('本职工作',19);
- insert into user(name,age) values('张工作',22);
- insert into user(name,age) values('王作',29);