ttys3 / utterances-cmt

this repo holds comments for utterances
0 stars 0 forks source link

post/failed-to-read-auto-increment-value-from-storage-engine/ #10

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

1467 - Failed to read auto-increment value from storage engine :: /dev/ttyS3 — 回首向来萧瑟处 也无荒野也无灯

插入数据时自增id出错了 INSERTINTOxxxx(id,name,url,info)VALUES(NULL,'blahblahblah','/xxxx','');#1467 - Failed to read auto-increment value from storage engine 看看表的自增id现在是多少: ``SHOW CREATE TABLE xxxx CREATETABLExxxx(idtinyint(3)unsignedNOTNULLAUTO_INCREMENT,namevarchar(128)NOTNULLDEFAULT'',urlvarchar(255)NOTNULLDEFAULT'',infovarchar(255)NOTNULLDEFAULT'',PRIMARYKEY(id))ENGINE=InnoDBAUTO_INCREMENT=18446744073709551615DEFAULTCHARSET=utf8mb4WTF ? AUTO_INCREMENT=18446744073709551615 ?

https://ttys3.dev/post/failed-to-read-auto-increment-value-from-storage-engine/

lilydjwg commented 3 years ago

count? 不应该是 max 吗?

ttys3 commented 3 years ago

count? 不应该是 max 吗?

这个表是自增的,没有间断也没有删除.所以 count 和 max 是一样的.

另外后面这个语句是我写博客的时候脑补的,其实当时是直接用的肉眼看到的 max id,

不过, 正确的当然是用 max 啦.