這個問題可能是重複這些問題:錯誤:無法讀取存儲引擎自動遞增值
- Failed to read auto-increment value from the storage engine in MySQL
- mysql Failed to read auto-increment value from storage engine
- Failed to read auto-increment value from storage engine, Error Number: 1467
- Failed to read auto-increment value from storage engine. Cause?
無論如何,這些解決方案並不適合我,所以它似乎是相同的錯誤但不同的原因。
情況:在MySQL中,我有一個表有一個「id」 - 列(主鍵),它具有AUTO_INCREMENT
屬性集。每次我嘗試插入新行到該表中,我得到了以下錯誤:
Failed to read auto-increment value from storage engine.
在解決上面提到的問題是重置與自動遞增值:
ALTER TABLE `table_name` AUTO_INCREMENT = 1
在我的情況這工作正常,只要我不重新啓動我的電腦。當我這樣做時,我再次遇到錯誤。
附加信息:
這裏是我的CREATE TABLE
:
CREATE TABLE `producer` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL,
`setup_cost` double NOT NULL,
`delivery_time` int(5) NOT NULL,
`stock_delivery_time` int(5) NOT NULL,
`country` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
當執行SHOW TABLE STATUS
我已經意識到奇怪的事情:Auto_increment
被設置爲0,Create_time
被設置爲「慢速英語「17:00:46」儘管我在一個月前製作了這張表。
我也使用MySQL命令CHECK TABLE tablename EXTENDED
(thx @ToBe,請參閱註釋)檢查損壞的數據,但未發現錯誤。
由於我對MySQL不是很熟悉,請告訴我是否忘記在評論中提供任何必要的信息。
任何幫助非常感謝,提前致謝!
你檢查了腐敗的表嗎?在你的mysql文件夾中應該有一些工具。 – ToBe
@ToBe謝謝你的提示,我用MySQL命令'CHECK TABLE tablename EXTENDED'檢查了表,但沒有發現錯誤。 – Jbartmann