InnoDB


InnoDB Tables
InnoDB tables provide full ACID transaction support (see Chapter 1 for the defini-
tion of ACID) and row-level locking. Though other transactional table types are
available in MySQL, InnoDB is probably the transactional table that most readers of
this book will decide to use. MySQL AB (the company that maintains MySQL) pack-
ages InnoDB tables with its standard distribution and is working closely with
Innobase (
http://www.innobase.com) to see that these tables work well with MySQL.
If you’re hosting your application at an ISP, you’ll want to make sure that the
host supports InnoDB tables before you write your applications for those tables.
You can check to see that these tables are available by running the following query:
show variables like ‘have%’.

mysql> show variables like ‘have%’;
+—————+——-+
| Variable_name | Value |
+—————+——-+
| have_bdb | NO |
| have_innodb | YES |
| have_isam | YES |
| have_raid | NO |
| have_symlink | YES |
| have_openssl | NO |
+—————+——-+
6 rows in set (0.30 sec)
As you can see from the preceding output, the value for have_innodb is YES. If
the value on your or your ISP’s system is NO, InnoDB tables are not available.
To create InnoDB tables add type=innodb to your create statement, as follows:
create table mytable(
col1 int,
col2 text
) type=innodb;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s