mysql插入中文的问题

mysql表中的字段为 memo varchar(700),
我insert into table1(memo) values('注意防寒保暖');
在mysql浏览器中插入时总提示插入的数据长度too long,
后来发现是表的编码问题,修改表的编码问题也没起作用,我drop表后,
新建表,如下:
create table table1
(
'id' decimal(2,0) not null,
'memo' varchar(700),
unique('id')
) ENGINE=InnoDB DEFAULT CHARSET=gbk;
再插入中文成功了。做此文章以勉,少走弯路。

你可能感兴趣的:(mysql,浏览器)