shell> cp /backup_directory/actor.ibd path/to/mysql-5.7/data /sakila/ 

4. Ensure that the .ibd  file has the necessary file permissions. 

5. Import the orphan .ibd  file. A warning is issued indicating that InnoDB  is attempting to import the file without schema verification. 

## 15.21.4 InnoDB Error Handling 

mysql> ALTER TABLE sakila.actor IMPORT TABLESPACE; SHOW WARNINGS; Query OK, 0 rows affected, 1 warning (0.15 sec) Warning | 1810 | InnoDB: IO Read error: (2, No such file or directory) Error opening ’./sakila/actor.cfg’, will attempt to import without schema verification 

6. Query the table to verify that the .ibd  file was successfully restored. 

mysql> SELECT COUNT(*) FROM sakila.actor; +----------+ | count(*) | +----------+ | 200 | +----------+ 

The following items describe how InnoDB  performs error handling. InnoDB  sometimes rolls back only the statement that failed, other times it rolls back the entire transaction. 

•If you run out of file space in a tablespace, a MySQL Table is full  error occurs and InnoDB  rolls back the SQL statement. 

•A transaction deadlock causes InnoDB  to roll back the entire transaction. Retry the entire transaction when this happens. 

A lock wait timeout causes InnoDB  to roll back the current statement (the statement that was waiting for the lock and encountered the timeout). To have the entire transaction roll back, start the server with --innodb-rollback-on-timeout  enabled. Retry the statement if using the default behavior, or the entire transaction if --innodb-rollback-on-timeout  is enabled. 

Both deadlocks and lock wait timeouts are normal on busy servers and it is necessary for applications to be aware that they may happen and handle them by retrying. You can make them less likely by doing as little work as possible between the first change to data during a transaction and the commit, so the locks are held for the shortest possible time and for the smallest possible number of rows. Sometimes splitting work between different transactions may be practical and helpful. 

•A duplicate-key error rolls back the SQL statement, if you have not specified the IGNORE  option in your statement. 

•A row too long error  rolls back the SQL statement. 

•Other errors are mostly detected by the MySQL layer of code (above the InnoDB  storage engine level), and they roll back the corresponding SQL statement. Locks are not released in a rollback of a single SQL statement. 

During implicit rollbacks, as well as during the execution of an explicit ROLLBACK  SQL statement, SHOW PROCESSLIST  displays Rolling back  in the State  column for the relevant connection. 

## 15.22 InnoDB Limits 

