mysql> Create table student(
-> id int unsigned not null primary key auto_increment,
-> name varchar(30),
-> age tinyint unsigned,
-> high decimal(5,2),
-> gender enum("男","女","保密") default "保密",
-> cls_id int unsigned
-> );
ERROR 1067 (42000): Invalid default value for 'gender'
如上述,在创建表的过程中出现中文,编码格式不支持,修改编码格式如下图命令:
mysql> show variables like '%char%';
# 查询编码格式
mysql> alter database python04new character set utf8;
# 修改为“utf-8”