以下的文章主要介紹的是 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);