The following is a nonexhaustive list of common
InnoDB-specific errors that you may
encounter, with information about why each occurs and how to
resolve the problem.
1005 (ER_CANT_CREATE_TABLE)
Cannot create table. If the error message refers to error
150, table creation failed because a foreign key constraint
was not correctly formed. If the error message refers to
error –1, table creation probably failed because the
table includes a column name that matched the name of an
internal InnoDB table.
1016 (ER_CANT_OPEN_FILE)
Cannot find the InnoDB table from the
InnoDB data files, although the
.frm file for the table exists. See
Section 14.3.14.4, “Troubleshooting InnoDB Data Dictionary Operations”.
1114 (ER_RECORD_FILE_FULL)
InnoDB has run out of free space in the
tablespace. Reconfigure the tablespace to add a new data
file.
1205 (ER_LOCK_WAIT_TIMEOUT)
Lock wait timeout expired. The statement that waited too
long was rolled back
(not the entire
transaction). You
can increase the value of the
innodb_lock_wait_timeout
configuration option if SQL statements should wait longer
for other transactions to complete, or decrease it if too
many long-running transactions are causing
locking problems and
reducing concurrency
on a busy system.
1206 (ER_LOCK_TABLE_FULL)
The total number of locks exceeds the lock table size. To
avoid this error, increase the value of
innodb_buffer_pool_size.
Within an individual application, a workaround may be to
break a large operation into smaller pieces. For example, if
the error occurs for a large
INSERT, perform several
smaller INSERT operations.
1213 (ER_LOCK_DEADLOCK)
The transaction
encountered a deadlock
and was automatically rolled
back so that your application could take corrective
action. To recover from this error, run all the operations
in this transaction again. A deadlock occurs when requests
for locks arrive in inconsistent order between transactions.
The transaction that was rolled back released all its locks,
and the other transaction can now get all the locks it
requested. Thus when you re-run the transaction that was
rolled back, it might have to wait for other transactions to
complete, but typically the deadlock does not recur. If you
encounter frequent deadlocks, make the sequence of locking
operations (LOCK TABLES, SELECT
... FOR UPDATE, and so on) consistent between the
different transactions or applications that experience the
issue. See Section 14.3.9.9, “How to Cope with Deadlocks” for details.
1216 (ER_NO_REFERENCED_ROW)
You are trying to add a row but there is no parent row, and a foreign key constraint fails. Add the parent row first.
1217 (ER_ROW_IS_REFERENCED)
You are trying to delete a parent row that has children, and a foreign key constraint fails. Delete the children first.