Failed to read the value of the automatic growth from the storage engine, error number: 1467

When pasting data into mysql, I get this error:

Error number: 1467 Failed to read the value of the automatic growth from the storage engine

I do not understand how to solve this problem, please any help would be appreciated.

+8
mysql
source share
9 answers

After some searching, I found the answer, and it solved my problem.

run this sql query, it will fix the problem

ALTER TABLE `YOUR_TABLE` AUTO_INCREMENT =1 
+9
source share

One possible explanation for this behavior is that the auto-increment value has reached the maximum value for the data type, and it is not possible for the database engine to increase it by one.

I suggest you check the current value. One relatively easy way to do this is to run SHOW CREATE TABLE mytable; The table definition will show the current value. (You can also request the presentation of information_schema.tables to get the same information.)

+3
source share

I also received this message. My problem was that my table did not sort by index. Try using the following:

 ALTER TABLE `YOUR-TABLE` ORDER BY `index` ; 
+3
source share

To add a little comment to kiddingmu's answer, we are talking not only about the number of digits, but also about the range of the data type. If the column is INT (11), 11 says that 11 digits are used for display; but this does not release the restriction that INT can only encode the range -2147483648: 2147483647 and 0: 4294967295 when unsigned.

So: for an INT (11) column, AUTO_INCREMENT 10000000000 will work; AUTO_INCREMENT 90000000000 will not be, despite the fact that it is 11 digits.

If a larger range is required, a different type should be used, such as BIGINT .

+3
source share

According to spencer7593, the auto-increment value has reached the maximum value for the data type

I just came up with a problem.

use the SHOW CREATE TABLE tablename command ; , I get

 table name { `id` int(11) NOT NULL AUTO_INCREMENT, ...... }ENGINE=InnoDB AUTO_INCREMENT=100000000000 DEFAULT CHARSET=utf8 

You will see that the length of 100,000,000,000 is 12, beyond the limit of 11.

+1
source share

Check the database structure correctly. I also ran into this problem, but found some error in the database structure. After correcting the structure, the problems were resolved.

0
source share

Another possibility with this error is that you hit the maximum value in the ID field (usually INT). We had this error when our identification values ​​approached 4294967295. We had to abandon the identifier from the table in order to avoid the problem. Various INT fields are mentioned in this answer: stack overflow

0
source share

I had the same problem after changing the column id to id and after exporting my db, so I just switched the column back to id and then returned to id again and everything worked fine after that. When working with elequent orm in laravel, it expects a column id, and I have a column id, so I changed it first

0
source share
 ps aux | grep mysql sudo kill (your pid) /etc/init.d/mysql restart 
-one
source share

All Articles