|
|||||||||||||||||||||||||||
|
Skip navigation links
Additional languages MySQL 3.23, 4.0, 4.1 Reference Manual :: 13 Storage Engines Section Navigation [Toggle]
Table of Contents [+/-]
MySQL supports several storage engines that act as handlers for different table types. MySQL storage engines include both those that handle transaction-safe tables and those that handle non-transaction-safe tables:
This chapter describes each of the MySQL storage engines except for
When you create a new table, you can specify which storage engine to
use by adding an
CREATE TABLE t (i INT) ENGINE = INNODB; CREATE TABLE t (i INT) TYPE = MEMORY;
If you omit the
You can set the default storage engine to be used during the current
session by setting the SET storage_engine=MYISAM; SET table_type=BDB;
When MySQL is installed on Windows using the MySQL Configuration
Wizard, the
To convert a table from one storage engine to another, use an
ALTER TABLE t ENGINE = MYISAM; ALTER TABLE t TYPE = BDB;
See Section 12.1.5, â
If you try to use a storage engine that is not compiled in or that
is compiled in but deactivated, MySQL instead creates a table using
the default storage engine, usually This automatic substitution of the default storage engine for unavailable engines can be confusing for new MySQL users. In MySQL 4.1, a warning is generated when a storage engine is automatically changed.
For new tables, MySQL always creates an A database may contain tables of different types. That is, tables need not all be created with the same storage engine. Transaction-safe tables (TSTs) have several advantages over non-transaction-safe tables (NTSTs):
You can combine transaction-safe and non-transaction-safe tables in
the same statements to get the best of both worlds. However,
although MySQL supports several transaction-safe storage engines,
for best results, you should not mix different storage engines
within a transaction with autocommit disabled. For example, if you
do this, changes to non-transaction-safe tables still are committed
immediately and cannot be rolled back. For information about this
and other problems that can occur in transactions that use mixed
storage engines, see Section 12.4.1, â
Note that to use the Non-transaction-safe tables have several advantages of their own, all of which occur because there is no transaction overhead:
© 1995-2008 MySQL AB. All rights reserved. |
||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||



User Comments
I have tried setting the storage engine or table type in my.cnf as well as in the command line. These appear to be unknown variables in 4.1.7. This is on a Mac OS X 10.3.5 machine.
To set the default engine use this in the my.cnf file: default-table-type=NDBCLUSTER
From the command line use: --default-table-type=NDBCLUSTER
I've tried setting up the default storage engine in the configuration, and if I use:
table_type = innodb
or
storage_engine = innodb
mysqld would fail to restart. I've now used:
default-storage_engine = innodb
And it works. See also http://bugs.mysql.com/bug.php?id=19061
More information about how to pick the best MySQL Storage engine for your real life scenario:
http://www.softwareprojects.com/resources/programming/t-mysql-storage-engines-1470.html
Add your own comment.