Failed to read auto-increment value from storage engine

分类:Database 2010-03-06 来源:CodeWeblog.com 人气:359

The project has encountered a problem, that is, data stored on a table when an error, "Failed to read auto-increment value from storage engine". In the structure of the table after a careful examination of the table auto_increment values are found in a very large value (18446744073709551615, is in the mysql bigint unsign value). So I manually set a value of 1 (ALTER TABLE target_table AUTO_INCREMENT = 1). But still does not work, the value has not changed.

Search for a lot of information online, a more consistent argument is that a mysql bug, need to upgrade the database. I have to trouble, do not upgrade my mysql. So would like to find other ways. I use the mysql console is phpmyadmin, accidentally discovered several operating options, such as optimization of the data table and on the table flush operation. Really played a role.
Concrete action is:
1. Select the destination table, click Operations, find the following Table maintenance list. Here are a few data sheet repair option.
2. Click Optimize Table, will implement the following sql statement: OPTIMIZE TABLE target_table.
3. After the return to Operations. Find Flush the table ("FLUSH"). Will implement the following sql statement:
FLUSH TABLE target_table.
At this point you can not AUTO_INCREMENT set to a large value can be received.

Project to use JPA, the database is automatically created, as to why, after you create the table AUTO_INCREMENT values will be set to a maximum value, which has still not clear. I do not know their own problems or database program, an error occurred.

Just make a record to facilitate future inquiries. If someone have similar problems, hope to exchange the next.

================================================== ==============
After the release of this article, I still did not find out the specific reasons, simply to test the database upgrade, the original version is 5.1.28, after upgrading the database version is 5.1.43. Once again rebuilt the database and found no problems. Really is a bug ah mysql database.

分享到:
blog comments powered by Disqus

相关文章

  • Oracle SQL statement of the operator Optimization - Optimization Analysis 2010-09-04

    Oracle SQL statement of the operator Optimization - Optimization Analysis Operator optimization IN operator IN written with the advantages of SQL is easier to write and clear easy to understand, is more suitable for modern software development style.

  • Reposted elsewhere - by analyzing the SQL statement execution plan optimization of SQL (summary) 2010-06-30

    By analyzing the SQL statement execution plan optimization of SQL (summary) DBA did almost 7 years, and sentiment among many. In the DBA's daily work, to adjust individual performance to a less challenging when the SQL statement of work. The key lies

  • Optimization of SQL statement based on the index of 2010-03-15

    1 Introduction 2 2 Master 2 3 Eighteen 3 The first metacarpal to avoid the operation of the column 3 The second metacarpal to avoid unnecessary type conversions 4 The third metacarpal increased to limit the query 4 Get rid of the fourth metacarpal as

  • Database Tuning-SQL statement optimization (especially for program development users) 2011-05-26

    Part 3 SQL statement execution plan row Proper use of the index HINTS affect SQL operation plan using 1 SQL statement execution plan 1.1 The use of execution plan. Use explain plan for the command (need to establish plan_table, after parsing the results f

  • Turn: oracle sql statement optimization 2010-10-25

    Transfer: http://www.blogjava.net/killme2008/archive/2007/03/02/101434.html (1) choose the most efficient sequence table name (only in the rule-based optimizer effectively): ORACLE parser in accordance with the order processing from right to left in the F

  • SQL statement optimization 34 (often used with use) 2011-02-18

    1) Select the most efficient sequence table name (only in the rule-based optimizer effectively): ORACLE parser in accordance with the order processing from right to left in the FROM clause table name, FROM clause written in the last table (base table driv

  • SQL statement optimization (b) 2011-04-15

    (1) choose the most efficient sequence table name (only in the rule-based optimizer effectively): ORACLE parser in accordance with the order processing from right to left in the FROM clause table name, FROM clause written in the last table (base table dri

  • sql statement optimization 2 2011-05-17

    Not only do we have to write SQL, but also do write excellent performance of SQL, the following is the author study, abstracted, and summarized some of the information to share with you! (1) choose the most efficient sequence table name (only in the rule-

  • MySQL database storage engine and branch status 2010-10-29

    (This article published in 2010.10.01 in the "grassroots" Journal of Phase IV, LAMP super-group AC (500): 106 382 633) Experience in MySQL Sun's acquisition in 2008 and 2009 Sun Oracle acquired in the process of development of the situation

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.377 (s). 14 q(s)