mysql报错信息_MySQL遇到的报错信息(截止到7.17)

-----------------------------------------------------------------7.16---------------------------------------------------------------

1.ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

mysql> create table grades06(

-> id int not null auto_increment,

-> name varchar(12) primary key,

-> grade float default 0);

ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

自增列只能有1列, 且这列必须为key,改后如下:

mysql> create table grades06(

-> id int not null auto_increment primary key,

-> name varchar(12),

-> grade float default 0);

Query OK, 0 rows affected (0.02 sec)

2.Multiple primary key defined

定义了多个主键,我们要知道每个数据表最多只能有一个主键约束。

3.Incorrect prefix key; the used key part isn’t a string, the used length is longer than the key part, or the storage engine doesn’t support unique prefix keys

索引中的的长度超出了字段数据类型定义的长度。解决办法是索引中不写长度,或者把长度改到相应的长度以内。

-----------------------------------------------------------------7.17---------------------------------------------------------------

4.ERROR 1364 (HY000): Field ‘xxxx’ doesn’t have a default value,

字段xxxx为非空约束,不能插入空值。

本文地址:https://blog.csdn.net/m0_45240384/article/details/107383097

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值