ERROR 1067 (42000): Invalid default value for 'add'
插入数据有中文报错;
原因:未设置字符集;
解决方案:
set names gbk;
设置之后,插入成功:
mysql> create table stu3(
-> id int auto_increment primary key comment '主键',
-> name varchar(20) not null comment '姓名',
-> `add` varchar(50) not null default '地址不详' comment '地址',
-> score int comment '成绩'
-> )engine=myisam charset=gbk;
Query OK, 0 rows affected (0.00 sec)