Home » PHP/MySQL » Failed To Read Auto-Increment Value From Storage Engine – MySQL

Failed To Read Auto-Increment Value From Storage Engine Error in MySQL.

This is a very strange MySQL error. The error happens when trying to insert a new row in to a table. Basically this is a bug in MySQL that causes the problem but a work around is simple. The problem happens when the Auto-Increment value of a table grows beyond the limit.

Just run this SQL query in MySQL command line to fix the issue in your table.

ALTER TABLE `table_name`  AUTO_INCREMENT =1

Table_name is the name of the table where you found the error while inserting data into. Don’t bother about the Auto_Increment value even if you have records in your table.

If this solution didn’t work on a 64bit machine, try the solution suggested by ZVZ below. “removing auto_increment from key and setting it back auto_increment value returned”

Tags: ,

28 Comments

  1. salim says:

    Hi aneeska,
    thanks for the solution.it worked perfectly for me.

  2. Aneeska says:

    Great to know salim!

  3. Sourav says:

    This tips has come very useful.

  4. Anoop says:

    Thanks man.

  5. venu volla says:

    Thaks Mate. It fixed mine too. I wish i were in a position to Donate you.

  6. zvz says:

    On wamp where mysql version is 5.1.30 running on windows 7 64bit, it did not work.
    By running alter table it happens something (I see altered rows), but value does not fix, so after refresh it comes back to null. Mysteriously removing auto_increment from key and setting it back auto_increment value returned. Probably it 64 bit issues, but hope someone will save hours by resetting ID key to non auto_increment and setting back!

  7. Fabio says:

    Thank’s a lot Aneeska!!! It works! I searched all afternoon on mysql website and nothing changed then…..I found your great great great solution and….worked!!!

  8. rai says:

    tnx bro.. make more tutorial likes this.. its easy to understand… tnx again..

  9. Akshay says:

    thanks,
    it works for me…. :)

  10. Soumitra Bhatt says:

    Hey Thanks it solved my problem :) happy coding

  11. Hamza says:

    Salut,
    je tiens a vous remercie pour la solutions, c’était vraiment utile et même très apprécie de votre part

  12. Graham says:

    thank you…..fixed it much appreciated…how did you find the problem?

  13. peeyush says:

    thanx man ….. well can you explain how this command works …

  14. Hey Thanks it solved my problem and save my time :)

  15. Kundan says:

    Thanks A lot guys..It saved my Time

  16. mahdi jamshidian says:

    thank you it is work for me.

  17. mrc says:

    Saved my bacon, thanks…

  18. L says:

    thanks aneeska. thank you so much.its works!

  19. james says:

    thanks aneeska… it worked perfectly for me too…

  20. maria says:

    very useful ….thanks a lot

  21. JManuel says:

    Me ha funcionado, gracias

  22. morteza says:

    Hello
    I face with this strange problem and that takes place when my db was empty and when I add one row from insert tab for the next try from my php program the error stops.

    BTW, I used `imageID` as Auto inc… and when I change the name to `id` the problem was fully solved.

  23. carlo says:

    it`s workin thanks

Leave a Reply

Page optimized by WP Minify WordPress Plugin