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