MySQL 数据库 InnoDB引擎的插值问题

来源:互联网 发布:温州动车事故真相 知乎 编辑:程序博客网 时间:2024/06/06 13:03

InnoDB是mysql数据库中唯一一个支持外键的引擎,但是差值的时候却得注意一下

比如有两张表,album(id,name,path) ,picture(id,name,path,parent_album),其中表2中parent_album是外键

此时差值insert into picture (name,path,parent_album) values ("pic","path",68) (68是一个相册的id)

mysql会报错"Failed to read auto-increment value from storage engine”

这么写就没问题

insert into picture set name="...", path="...",id=68

原创粉丝点击