为了账号安全,请及时绑定邮箱和手机立即绑定

mysql ERROR 1364 (HY000): Field 'name' doesn't have a default value 怎么解决

mysql ERROR 1364 (HY000): Field 'name' doesn't have a default value 怎么解决

qq_小杜_1 2017-04-22 21:06:55
mysql> create table Teachher(    -> id int(4) primary key not null unique auto_increment,    -> num int(10) not null unique,    -> name varchar(20) not null,    -> sex varchar(4) not null,    -> birthday datetime,    -> address varchar(59)    -> );Query OK, 0 rows affected (0.67 sec)mysql> desc Teachher;+----------+-------------+------+-----+---------+----------------+| Field    | Type        | Null | Key | Default | Extra          |+----------+-------------+------+-----+---------+----------------+| id       | int(4)      | NO   | PRI | NULL    | auto_increment || num      | int(10)     | NO   | UNI | NULL    |                || name     | varchar(20) | NO   |     | NULL    |                || sex      | varchar(4)  | NO   |     | NULL    |                || birthday | datetime    | YES  |     | NULL    |                || address  | varchar(59) | YES  |     | NULL    |                |+----------+-------------+------+-----+---------+----------------+6 rows in set (0.01 sec)mysql> insert into Teachher(num)    -> values('2513');ERROR 1364 (HY000): Field 'name' doesn't have a default valuemysql> insert into Teachher(num)    -> values(2513);ERROR 1364 (HY000): Field 'name' doesn't have a default value
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 2323 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信