InnoDBStartup Options and System Variables
InnoDBData and Log Files
InnoDBDatabase to Another Machine
InnoDBTransaction Model and Locking
InnoDBTable and Index Structures
InnoDBDisk I/O and File Space Management
InnoDBPerformance Tuning and Troubleshooting
InnoDB is a transaction-safe (ACID compliant)
storage engine for MySQL that has commit, rollback, and
crash-recovery capabilities to protect user data.
InnoDB row-level locking (without escalation to
coarser granularity locks) and Oracle-style consistent nonlocking
reads increase multi-user concurrency and performance.
InnoDB stores user data in clustered indexes to
reduce I/O for common queries based on primary keys. To maintain
InnoDB also supports
FOREIGN KEY referential-integrity constraints.
You can freely mix
InnoDB tables with tables from
other MySQL storage engines, even within the same statement.
InnoDB Storage Engine
|Storage limits||64TB||Transactions||Yes||Locking granularity||Row|
|MVCC||Yes||Geospatial datatype support||Yes||Geospatial indexing support||No|
|B-tree indexes||Yes||Hash indexes||No||Full-text search indexes||No|
|Clustered indexes||Yes||Data caches||Yes||Index caches||Yes|
|Compressed data||Yes[a]||Encrypted data[b]||Yes||Cluster database support||No|
|Replication support[c]||Yes||Foreign key support||Yes||Backup / point-in-time recovery[d]||Yes|
|Query cache support||Yes||Update statistics for data dictionary||Yes|
[a] Compressed InnoDB tables are supported only by InnoDB Plugin.
[b] Implemented in the server (via encryption functions), rather than in the storage engine.
[c] Implemented in the server, rather than in the storage product
[d] Implemented in the server, rather than in the storage product
InnoDB has been designed for maximum performance
when processing large data volumes. Its CPU efficiency is probably
not matched by any other disk-based relational database engine.
InnoDB storage engine maintains its own
buffer pool for caching data and indexes in main memory.
InnoDB stores its tables and indexes in a
tablespace, which may consist of several files (or raw disk
partitions). This is different from, for example,
MyISAM tables where each table is stored using
InnoDB tables can be very large
even on operating systems where file size is limited to 2GB.
The Windows Essentials installer makes
MySQL default storage engine on Windows, if the server being
InnoDB is used in production at numerous large
database sites requiring high performance. The famous Internet news
site Slashdot.org runs on
InnoDB. Mytrix, Inc.
stores more than 1TB of data in
another site handles an average load of 800 inserts/updates per
InnoDB is published under the same GNU GPL
License Version 2 (of June 1991) as MySQL. For more information on
MySQL licensing, see http://www.mysql.com/company/legal/licensing/.
A forum dedicated to the
engine is available at http://forums.mysql.com/list.php?22.
Innobase Oy also hosts several forums, available at http://forums.innodb.com.
At the 2008 MySQL User Conference, Innobase announced
availability of an
InnoDB Plugin for MySQL.
This plugin for MySQL exploits the “pluggable storage
engine” architecture of MySQL, to permit users to replace
the “built-in” version of
in MySQL 5.1.
As of MySQL 5.1.38, the
InnoDB Plugin is
included in MySQL 5.1 releases, in addition to the
built-in version of
InnoDB that has been
included in previous releases. MySQL 5.1.42 through 5.1.45
InnoDB Plugin 1.0.6, which is
considered of Release Candidate (RC) quality. MySQL 5.1.46 and
InnoDB Plugin 1.0.7, which is
considered of General Availability (GA) quality.
Currently, MySQL Cluster is not compatible with the
InnoDB Plugin. See
Section 17.2.1, “MySQL Cluster Multi-Computer Installation”.
InnoDB Plugin offers new features,
improved performance and scalability, enhanced reliability and
new capabilities for flexibility and ease of use. Among the
features of the
InnoDB Plugin are “Fast
index creation,” table and index compression, file format
capacity tuning, multiple background I/O threads, and group
For information about these features, see the
Plugin Manual at
For general information about using
MySQL, see Section 13.6, “The
InnoDB Storage Engine”.
InnoDB Plugin is included in source and
binary distributions, except RHEL3, RHEL4, SuSE 9 (x86, x86_64,
ia64), and generic Linux RPM packages.
To use the
InnoDB Plugin, you must disable
the built-in version of
InnoDB that is also
included and instruct the server to use
Plugin instead. To accomplish this, use the following
lines in your
[mysqld] ignore-builtin-innodb plugin-load=innodb=ha_innodb_plugin.so
innodb is the name to associate with the
ha_innodb_plugin.so is the name
of the shared object library that contains the plugin code. The
.so applies for Unix (and
similar) systems. For HP-UX on HPPA (11.11) or Windows, the
extension should be
.dll, respectively, rather than
If the server has problems finding the plugin when it starts up,
specify the pathname to the plugin directory. For example, if
plugins are located in the
directory under the MySQL installation directory and you have
installed MySQL at
these lines in your
[mysqld] ignore-builtin-innodb plugin-load=innodb=ha_innodb_plugin.so plugin_dir=/usr/local/mysql/lib/mysql/plugin
The previous examples show how to activate the storage engine
InnoDB Plugin, but the plugin also
implements several InnoDB-related
INFORMATION_SCHEMA tables. (For information
about these tables, see
To enable these tables, include additional
pairs in the value of the
[mysqld] ignore-builtin-innodb plugin-load=innodb=ha_innodb_plugin.so ;innodb_trx=ha_innodb_plugin.so ;innodb_locks=ha_innodb_plugin.so ;innodb_lock_waits=ha_innodb_plugin.so ;innodb_cmp=ha_innodb_plugin.so ;innodb_cmp_reset=ha_innodb_plugin.so ;innodb_cmpmem=ha_innodb_plugin.so ;innodb_cmpmem_reset=ha_innodb_plugin.so
plugin-load option value as
shown here is formatted on multiple lines for display purposes
but should be written in
my.cnf using a
single line without spaces in the option value. On Windows,
.dll for each instance of the
After the server starts , verify that
Plugin has been loaded by using the
SHOW PLUGINS statement. For
example, if you have loaded the storage engine and the
INFORMATION_SCHEMA tables, the output should
include lines similar to these:
SHOW PLUGINS;+---------------------+--------+--------------------+... | Name | Status | Type |... +---------------------+--------+--------------------+... ... | InnoDB | ACTIVE | STORAGE ENGINE |... | INNODB_TRX | ACTIVE | INFORMATION SCHEMA |... | INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA |... | INNODB_LOCK_WAITS | ACTIVE | INFORMATION SCHEMA |... | INNODB_CMP | ACTIVE | INFORMATION SCHEMA |... | INNODB_CMP_RESET | ACTIVE | INFORMATION SCHEMA |... | INNODB_CMPMEM | ACTIVE | INFORMATION SCHEMA |... | INNODB_CMPMEM_RESET | ACTIVE | INFORMATION SCHEMA |... +---------------------+--------+--------------------+...
An alternative to using the
plugin-load option at server
startup is to use the
PLUGIN statement at runtime. First start the server
option to disable the built-in version of
Then issue an
statement for each plugin that you want to load:
INSTALL PLUGIN InnoDB SONAME 'ha_innodb_plugin.so';mysql>
INSTALL PLUGIN INNODB_TRX SONAME 'ha_innodb_plugin.so';mysql>
INSTALL PLUGIN INNODB_LOCKS SONAME 'ha_innodb_plugin.so';...
INSTALL PLUGIN need be issued
only once for each plugin. Installed plugins will be loaded
automatically on subsequent server restarts.
If you build MySQL from a source distribution,
Plugin is one of the storage engines that is built by
default. Build MySQL the way you normally do; for example, by
using the instructions at Section 2.3, “MySQL Installation Using a Source Distribution”.
After the build completes, you should find the plugin shared
object file under the
directory, and make install should install it
in the plugin directory. Configure MySQL to use
Plugin as described earlier for binary distributions.
If you use gcc,
Plugin cannot be compiled with gcc
3.x; you must use gcc 4.x instead.
InnoDB Hot Backup enables you to back up a
running MySQL database, including
MyISAM tables, with minimal disruption to
operations while producing a consistent snapshot of the
database. When InnoDB Hot Backup is copying
InnoDB tables, reads and writes to both
can continue. During the copying of
tables, reads (but not writes) to those tables are permitted. In
addition, InnoDB Hot Backup supports creating
compressed backup files, and performing backups of subsets of
InnoDB tables. In conjunction with MySQL’s
binary log, users can perform point-in-time recovery.
InnoDB Hot Backup is commercially licensed by
Innobase Oy. For a more complete description of InnoDB
Hot Backup, see
or download the documentation from
You can order trial, term, and perpetual licenses from Innobase