在执行上面的操作之前,先执行:set names gbk;
见下例:
mysql> use test;
Database changed
mysql> set names gbk;
Query OK, 0 rows affected (0.01 sec)mysql> create table cc(id int not null auto_increment primary key,
-> name varchar(20));
Query OK, 0 rows affected (0.09 sec)mysql> insert into cc(name) values('张三');
Query OK, 1 row affected (0.05 sec)mysql> select * from cc;
+----+------+
| id | name |
+----+------+
| 1 | 张三 |
+----+------+
1 row in set (0.01 sec)
见下例:
mysql> use test;
Database changed
mysql> set names gbk;
Query OK, 0 rows affected (0.01 sec)mysql> create table cc(id int not null auto_increment primary key,
-> name varchar(20));
Query OK, 0 rows affected (0.09 sec)mysql> insert into cc(name) values('张三');
Query OK, 1 row affected (0.05 sec)mysql> select * from cc;
+----+------+
| id | name |
+----+------+
| 1 | 张三 |
+----+------+
1 row in set (0.01 sec)
解决方案 »
- MYSQL setting the connection property "retainStatementAfterResultSetClose" to "true".异常处理
- mysql送分题……
- MySQL的安装?
- 安装toad for mysql 中遇到的问题。
- linux下的mysql编码问题
- 怎么样能知道积分??
- 怎样修复mysql表---Incorrect information in file: '.\mydata\a.frm'
- postgresql连接错误!
- 用户建立和权限的问题?
- 请问谁有mysql.h这个头文件?
- mysql怎么不可以暂停trigger啊?
- 怎样在fc5上安装mysql?
登陆mysql:mysql --default-character-set=gbk -u root
OK。