代码:create database bbs;use bbs;create table article 
(
id int primary key auto_increment,
pid int,
rootid int,
title varchar(255),
cont text,
pdate datetime,
isleaf int 
);insert into article values (null, 0, 1, '蚂蚁大战大象', '蚂蚁大战大象', now(), 1);
insert into article values (null, 1, 1, '大象被打趴下了', '大象被打趴下了',now(), 1);
insert into article values (null, 2, 1, '蚂蚁也不好过','蚂蚁也不好过', now(), 0);
insert into article values (null, 2, 1, '瞎说', '瞎说', now(), 1);
insert into article values (null, 4, 1, '没有瞎说', '没有瞎说', now(), 0);
insert into article values (null, 1, 1, '怎么可能', '怎么可能', now(), 1);
insert into article values (null, 6, 1, '怎么没有可能', '怎么没有可能', now(), 0);
insert into article values (null, 6, 1, '可能性是很大的', '可能性是很大的', now(), 0);
insert into article values (null, 2, 1, '大象进医院了', '大象进医院了', now(), 1);
insert into article values (null, 9, 1, '护士是蚂蚁', '护士是蚂蚁', now(), 0);错误:
   ERROR 1366 (HY000): Incorrect string value: '\xC2\xEC\xD2\xCF\xB4\xF3...' for co
lumn 'title' at row 1
ERROR 1366 (HY000): Incorrect string value: '\xB4\xF3\xCF\xF3\xB1\xBB...' for co
lumn 'title' at row 1
ERROR 1366 (HY000): Incorrect string value: '\xC2\xEC\xD2\xCF\xD2\xB2...' for co
lumn 'title' at row 1
Query OK, 1 row affected (0.00 sec)ERROR 1366 (HY000): Incorrect string value: '\xD3\xD0\xCF\xB9\xCB\xB5' for colum
n 'title' at row 1
ERROR 1366 (HY000): Incorrect string value: '\xD4\xF5\xC3\xB4\xBF\xC9...' for co
lumn 'title' at row 1
ERROR 1366 (HY000): Incorrect string value: '\xD4\xF5\xC3\xB4\xC3\xBB...' for co
lumn 'title' at row 1
ERROR 1366 (HY000): Incorrect string value: '\xBF\xC9\xC4\xDC\xD0\xD4...' for co
lumn 'title' at row 1
ERROR 1366 (HY000): Incorrect string value: '\xB4\xF3\xCF\xF3\xBD\xF8...' for co
lumn 'title' at row 1
ERROR 1366 (HY000): Incorrect string value: '\xBB\xA4\xCA\xBF\xCA\xC7...' for co
lumn 'title' at row 1
mysql>

解决方案 »

  1.   

    你建表的时候加上这句话。engine=InnoDB default charset=gb2312;
    保证就可以向表中插入中文了。
      

  2.   

    create table article  
    (
    id int primary key auto_increment,
    pid int,
    rootid int,
    title varchar(255),
    cont text,
    pdate datetime,
    isleaf int  
    )engine=InnoDB default charset=gb2312;用utf-8也可以
      

  3.   

    字符集问题啊,mysql默认的是拉丁字符集吧
      

  4.   

    字符集问题。2楼,3楼正解。哈哈,楼主在做马士兵的BBS啊。 当初我也写过。 
      

  5.   

    最好在安装mysql的时候就把字符集改成gb2312
      

  6.   

    mysql 字符集问题、
    楼上说的都对头、mysql 默认的是latin1 字符集 拉丁文、你安装mysql时候最好编辑字符集为utf8字符集、最好还是设置utf8吧、如果是在mysql区 估计回答的人很多、