Author: paul
Date: 2008-11-05 23:01:26 +0100 (Wed, 05 Nov 2008)
New Revision: 12298
Log:
r35328@frost: paul | 2008-11-05 15:38:59 -0500
General InnoDB revisions
Modified:
trunk/refman-4.1/se-innodb-core.xml
trunk/refman-5.0/se-innodb-core.xml
trunk/refman-5.1/se-innodb-core.xml
trunk/refman-6.0/se-innodb-core.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:39854
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:35327
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:34100
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:39854
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:35328
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:34100
Modified: trunk/refman-4.1/se-innodb-core.xml
===================================================================
--- trunk/refman-4.1/se-innodb-core.xml 2008-11-05 22:01:15 UTC (rev 12297)
+++ trunk/refman-4.1/se-innodb-core.xml 2008-11-05 22:01:26 UTC (rev 12298)
Changed blocks: 6, Lines Added: 52, Lines Deleted: 39; 7099 bytes
@@ -1068,12 +1068,13 @@
<para>
It is best to run the MySQL server <command>mysqld</command>
from the command prompt when you first start the server with
- <literal>InnoDB</literal> enabled, not from the
- <command>mysqld_safe</command> wrapper or as a Windows service.
- When you run from a command prompt you see what
- <command>mysqld</command> prints and what is happening. On Unix,
- just invoke <command>mysqld</command>. On Windows, use the
- <option>--console</option> option.
+ <literal>InnoDB</literal> enabled, not from
+ <command>mysqld_safe</command> or as a Windows service. When you
+ run from a command prompt you see what <command>mysqld</command>
+ prints and what is happening. On Unix, just invoke
+ <command>mysqld</command>. On Windows, start
+ <command>mysqld</command> with the <option>--console</option>
+ option to direct the output to the console window.
</para>
<para>
@@ -2098,11 +2099,11 @@
with autocommit mode enabled, which automatically commits every
SQL statement as you execute it. To use multiple-statement
transactions, you can switch autocommit off with the SQL
- statement <literal>SET AUTOCOMMIT = 0</literal> and use
- <literal>COMMIT</literal> and <literal>ROLLBACK</literal> to
- commit or roll back your transaction. If you want to leave
- autocommit on, you can enclose your transactions within
- <literal>START TRANSACTION</literal> and either
+ statement <literal>SET AUTOCOMMIT = 0</literal> and end each
+ transaction with either <literal>COMMIT</literal> and
+ <literal>ROLLBACK</literal>. If you want to leave autocommit on,
+ you can begin your transactions within <literal>START
+ TRANSACTION</literal> and end them with
<literal>COMMIT</literal> or <literal>ROLLBACK</literal>. Before
MySQL 4.0.11, you have to use the keyword
<literal>BEGIN</literal> instead of <literal>START
@@ -2114,24 +2115,24 @@
<programlisting>
shell> <userinput>mysql test</userinput>
-mysql> <userinput>CREATE TABLE CUSTOMER (A INT, B CHAR (20), INDEX (A))</userinput>
+mysql> <userinput>CREATE TABLE customer (a INT, b CHAR (20), INDEX (A))</userinput>
-> <userinput>TYPE=InnoDB;</userinput>
Query OK, 0 rows affected (0.00 sec)
mysql> <userinput>BEGIN;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>INSERT INTO CUSTOMER VALUES (10, 'Heikki');</userinput>
+mysql> <userinput>INSERT INTO customer VALUES (10, 'Heikki');</userinput>
Query OK, 1 row affected (0.00 sec)
mysql> <userinput>COMMIT;</userinput>
Query OK, 0 rows affected (0.00 sec)
mysql> <userinput>SET AUTOCOMMIT=0;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>INSERT INTO CUSTOMER VALUES (15, 'John');</userinput>
+mysql> <userinput>INSERT INTO customer VALUES (15, 'John');</userinput>
Query OK, 1 row affected (0.00 sec)
mysql> <userinput>ROLLBACK;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>SELECT * FROM CUSTOMER;</userinput>
+mysql> <userinput>SELECT * FROM customer;</userinput>
+------+--------+
-| A | B |
+| a | b |
+------+--------+
| 10 | Heikki |
+------+--------+
@@ -2154,25 +2155,30 @@
<section id="converting-tables-to-innodb">
- <title>Converting <literal>MyISAM</literal> Tables to <literal>InnoDB</literal></title>
+ <title>Converting Tables from Other Storage Engines to
+ <literal>InnoDB</literal></title>
<para>
- Important: Do not convert MySQL system tables in the
- <literal>mysql</literal> database (such as
- <literal>user</literal> or <literal>host</literal>) to the
- <literal>InnoDB</literal> type. This is an unsupported
- operation. The system tables must always be of the
- <literal>MyISAM</literal> type.
+ To convert a non-<literal>InnoDB</literal> table to use
+ <literal>InnoDB</literal> use <literal role="stmt">ALTER
+ TABLE</literal>:
</para>
- <para>
- If you want all your (non-system) tables to be created as
- <literal>InnoDB</literal> tables, you can, starting from the
- MySQL 3.23.43, add the line
- <literal>default-table-type=innodb</literal> to the
- <literal>[mysqld]</literal> section of your server option file.
- </para>
+<programlisting>
+ALTER TABLE t1 TYPE=InnoDB;
+</programlisting>
+ <important>
+ <para>
+ Do not convert MySQL system tables in the
+ <literal>mysql</literal> database (such as
+ <literal>user</literal> or <literal>host</literal>) to the
+ <literal>InnoDB</literal> type. This is an unsupported
+ operation. The system tables must always be of the
+ <literal>MyISAM</literal> type.
+ </para>
+ </important>
+
<para>
<literal>InnoDB</literal> does not have a special optimization
for separate index creation the way the
@@ -2252,12 +2258,19 @@
<xref linkend="forcing-recovery"/>.
</para>
+ <para>
+ If you want all your (non-system) tables to be created as
+ <literal>InnoDB</literal> tables, you can, starting from the
+ MySQL 3.23.43, add the line
+ <literal>default-table-type=innodb</literal> to the
+ <literal>[mysqld]</literal> section of your server option file.
+ </para>
+
</section>
<section id="innodb-auto-increment-handling">
- <title>How <literal>AUTO_INCREMENT</literal> Handling Works in
- <literal>InnoDB</literal></title>
+ <title><literal>AUTO_INCREMENT</literal> Handling in <literal>InnoDB</literal></title>
<para>
If you specify an <literal>AUTO_INCREMENT</literal> column for
@@ -7669,13 +7682,13 @@
<listitem>
<para>
When troubleshooting, it is usually best to run the MySQL
- server from the command prompt, rather than through the
- <command>mysqld_safe</command> wrapper or as a Windows
- service. You can then see what <command>mysqld</command>
- prints to the console, and so have a better grasp of what is
- going on. On Windows, you must start the server with the
- <filename>--console</filename> option to direct the output to
- the console window.
+ server from the command prompt, rather than through
+ <command>mysqld_safe</command> or as a Windows service. You
+ can then see what <command>mysqld</command> prints to the
+ console, and so have a better grasp of what is going on. On
+ Windows, start <command>mysqld</command> with the
+ <option>--console</option> option to direct the output to the
+ console window.
</para>
</listitem>
Modified: trunk/refman-5.0/se-innodb-core.xml
===================================================================
--- trunk/refman-5.0/se-innodb-core.xml 2008-11-05 22:01:15 UTC (rev 12297)
+++ trunk/refman-5.0/se-innodb-core.xml 2008-11-05 22:01:26 UTC (rev 12298)
Changed blocks: 6, Lines Added: 51, Lines Deleted: 38; 7032 bytes
@@ -965,12 +965,13 @@
<para>
It is best to run the MySQL server <command>mysqld</command>
from the command prompt when you first start the server with
- <literal>InnoDB</literal> enabled, not from the
- <command>mysqld_safe</command> wrapper or as a Windows service.
- When you run from a command prompt you see what
- <command>mysqld</command> prints and what is happening. On Unix,
- just invoke <command>mysqld</command>. On Windows, use the
- <option>--console</option> option.
+ <literal>InnoDB</literal> enabled, not from
+ <command>mysqld_safe</command> or as a Windows service. When you
+ run from a command prompt you see what <command>mysqld</command>
+ prints and what is happening. On Unix, just invoke
+ <command>mysqld</command>. On Windows, start
+ <command>mysqld</command> with the <option>--console</option>
+ option to direct the output to the console window.
</para>
<para>
@@ -2224,11 +2225,11 @@
with autocommit mode enabled, which automatically commits every
SQL statement as you execute it. To use multiple-statement
transactions, you can switch autocommit off with the SQL
- statement <literal>SET AUTOCOMMIT = 0</literal> and use
- <literal>COMMIT</literal> and <literal>ROLLBACK</literal> to
- commit or roll back your transaction. If you want to leave
- autocommit on, you can enclose your transactions within
- <literal>START TRANSACTION</literal> and either
+ statement <literal>SET AUTOCOMMIT = 0</literal> and end each
+ transaction with either <literal>COMMIT</literal> or
+ <literal>ROLLBACK</literal>. If you want to leave autocommit on,
+ you can begin your transactions within <literal>START
+ TRANSACTION</literal> and end them with
<literal>COMMIT</literal> or <literal>ROLLBACK</literal>. The
following example shows two transactions. The first is
committed; the second is rolled back.
@@ -2237,24 +2238,24 @@
<programlisting>
shell> <userinput>mysql test</userinput>
-mysql> <userinput>CREATE TABLE CUSTOMER (A INT, B CHAR (20), INDEX (A))</userinput>
+mysql> <userinput>CREATE TABLE customer (a INT, b CHAR (20), INDEX (a))</userinput>
-> <userinput>ENGINE=InnoDB;</userinput>
Query OK, 0 rows affected (0.00 sec)
mysql> <userinput>START TRANSACTION;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>INSERT INTO CUSTOMER VALUES (10, 'Heikki');</userinput>
+mysql> <userinput>INSERT INTO customer VALUES (10, 'Heikki');</userinput>
Query OK, 1 row affected (0.00 sec)
mysql> <userinput>COMMIT;</userinput>
Query OK, 0 rows affected (0.00 sec)
mysql> <userinput>SET AUTOCOMMIT=0;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>INSERT INTO CUSTOMER VALUES (15, 'John');</userinput>
+mysql> <userinput>INSERT INTO customer VALUES (15, 'John');</userinput>
Query OK, 1 row affected (0.00 sec)
mysql> <userinput>ROLLBACK;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>SELECT * FROM CUSTOMER;</userinput>
+mysql> <userinput>SELECT * FROM customer;</userinput>
+------+--------+
-| A | B |
+| a | b |
+------+--------+
| 10 | Heikki |
+------+--------+
@@ -2277,24 +2278,30 @@
<section id="converting-tables-to-innodb">
- <title>Converting <literal>MyISAM</literal> Tables to <literal>InnoDB</literal></title>
+ <title>Converting Tables from Other Storage Engines to
+ <literal>InnoDB</literal></title>
<para>
- Important: Do not convert MySQL system tables in the
- <literal>mysql</literal> database (such as
- <literal>user</literal> or <literal>host</literal>) to the
- <literal>InnoDB</literal> type. This is an unsupported
- operation. The system tables must always be of the
- <literal>MyISAM</literal> type.
+ To convert a non-<literal>InnoDB</literal> table to use
+ <literal>InnoDB</literal> use <literal role="stmt">ALTER
+ TABLE</literal>:
</para>
- <para>
- If you want all your (non-system) tables to be created as
- <literal>InnoDB</literal> tables, you can simply add the line
- <literal>default-storage-engine=innodb</literal> to the
- <literal>[mysqld]</literal> section of your server option file.
- </para>
+<programlisting>
+ALTER TABLE t1 ENGINE=InnoDB;
+</programlisting>
+ <important>
+ <para>
+ Do not convert MySQL system tables in the
+ <literal>mysql</literal> database (such as
+ <literal>user</literal> or <literal>host</literal>) to the
+ <literal>InnoDB</literal> type. This is an unsupported
+ operation. The system tables must always be of the
+ <literal>MyISAM</literal> type.
+ </para>
+ </important>
+
<para>
<literal>InnoDB</literal> does not have a special optimization
for separate index creation the way the
@@ -2373,12 +2380,18 @@
<xref linkend="forcing-recovery"/>.
</para>
+ <para>
+ If you want all your (non-system) tables to be created as
+ <literal>InnoDB</literal> tables, add the line
+ <literal>default-storage-engine=innodb</literal> to the
+ <literal>[mysqld]</literal> section of your server option file.
+ </para>
+
</section>
<section id="innodb-auto-increment-handling">
- <title>How <literal>AUTO_INCREMENT</literal> Handling Works in
- <literal>InnoDB</literal></title>
+ <title><literal>AUTO_INCREMENT</literal> Handling in <literal>InnoDB</literal></title>
<para>
If you specify an <literal>AUTO_INCREMENT</literal> column for
@@ -7833,13 +7846,13 @@
<listitem>
<para>
When troubleshooting, it is usually best to run the MySQL
- server from the command prompt, rather than through the
- <command>mysqld_safe</command> wrapper or as a Windows
- service. You can then see what <command>mysqld</command>
- prints to the console, and so have a better grasp of what is
- going on. On Windows, you must start the server with the
- <filename>--console</filename> option to direct the output to
- the console window.
+ server from the command prompt, rather than through
+ <command>mysqld_safe</command> or as a Windows service. You
+ can then see what <command>mysqld</command> prints to the
+ console, and so have a better grasp of what is going on. On
+ Windows, start <command>mysqld</command> with the
+ <option>--console</option> option to direct the output to the
+ console window.
</para>
</listitem>
Modified: trunk/refman-5.1/se-innodb-core.xml
===================================================================
--- trunk/refman-5.1/se-innodb-core.xml 2008-11-05 22:01:15 UTC (rev 12297)
+++ trunk/refman-5.1/se-innodb-core.xml 2008-11-05 22:01:26 UTC (rev 12298)
Changed blocks: 7, Lines Added: 55, Lines Deleted: 41; 7677 bytes
@@ -983,12 +983,13 @@
<para>
It is best to run the MySQL server <command>mysqld</command>
from the command prompt when you first start the server with
- <literal>InnoDB</literal> enabled, not from the
- <command>mysqld_safe</command> wrapper or as a Windows service.
- When you run from a command prompt you see what
- <command>mysqld</command> prints and what is happening. On Unix,
- just invoke <command>mysqld</command>. On Windows, use the
- <option>--console</option> option.
+ <literal>InnoDB</literal> enabled, not from
+ <command>mysqld_safe</command> or as a Windows service. When you
+ run from a command prompt you see what <command>mysqld</command>
+ prints and what is happening. On Unix, just invoke
+ <command>mysqld</command>. On Windows, start
+ <command>mysqld</command> with the <option>--console</option>
+ option to direct the output to the console window.
</para>
<para>
@@ -2233,9 +2234,10 @@
<literal>InnoDB</literal> tablespace by issuing a
<literal role="stmt">SHOW TABLE STATUS</literal> statement for any
<literal>InnoDB</literal> table. The amount of free space in the
- tablespace appears in the <literal>Comment</literal> section in
- the output of <literal role="stmt">SHOW TABLE STATUS</literal>.
- For example:
+ tablespace appears in the <literal>Data_free</literal> section in
+ the output of <literal role="stmt">SHOW TABLE STATUS</literal> (or
+ the <literal>Comment</literal> section prior to MySQL 5.1.24). For
+ example:
</para>
<programlisting>
@@ -2258,11 +2260,11 @@
with autocommit mode enabled, which automatically commits every
SQL statement as you execute it. To use multiple-statement
transactions, you can switch autocommit off with the SQL
- statement <literal>SET AUTOCOMMIT = 0</literal> and use
- <literal>COMMIT</literal> and <literal>ROLLBACK</literal> to
- commit or roll back your transaction. If you want to leave
- autocommit on, you can enclose your transactions within
- <literal>START TRANSACTION</literal> and either
+ statement <literal>SET AUTOCOMMIT = 0</literal> and end each
+ transaction with either <literal>COMMIT</literal> or
+ <literal>ROLLBACK</literal>. If you want to leave autocommit on,
+ you can begin your transactions within <literal>START
+ TRANSACTION</literal> and end them with
<literal>COMMIT</literal> or <literal>ROLLBACK</literal>. The
following example shows two transactions. The first is
committed; the second is rolled back.
@@ -2271,24 +2273,24 @@
<programlisting>
shell> <userinput>mysql test</userinput>
-mysql> <userinput>CREATE TABLE CUSTOMER (A INT, B CHAR (20), INDEX (A))</userinput>
+mysql> <userinput>CREATE TABLE customer (a INT, b CHAR (20), INDEX (a))</userinput>
-> <userinput>ENGINE=InnoDB;</userinput>
Query OK, 0 rows affected (0.00 sec)
mysql> <userinput>START TRANSACTION;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>INSERT INTO CUSTOMER VALUES (10, 'Heikki');</userinput>
+mysql> <userinput>INSERT INTO customer VALUES (10, 'Heikki');</userinput>
Query OK, 1 row affected (0.00 sec)
mysql> <userinput>COMMIT;</userinput>
Query OK, 0 rows affected (0.00 sec)
mysql> <userinput>SET AUTOCOMMIT=0;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>INSERT INTO CUSTOMER VALUES (15, 'John');</userinput>
+mysql> <userinput>INSERT INTO customer VALUES (15, 'John');</userinput>
Query OK, 1 row affected (0.00 sec)
mysql> <userinput>ROLLBACK;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>SELECT * FROM CUSTOMER;</userinput>
+mysql> <userinput>SELECT * FROM customer;</userinput>
+------+--------+
-| A | B |
+| a | b |
+------+--------+
| 10 | Heikki |
+------+--------+
@@ -2311,24 +2313,30 @@
<section id="converting-tables-to-innodb">
- <title>Converting <literal>MyISAM</literal> Tables to <literal>InnoDB</literal></title>
+ <title>Converting Tables from Other Storage Engines to
+ <literal>InnoDB</literal></title>
<para>
- Important: Do not convert MySQL system tables in the
- <literal>mysql</literal> database (such as
- <literal>user</literal> or <literal>host</literal>) to the
- <literal>InnoDB</literal> type. This is an unsupported
- operation. The system tables must always be of the
- <literal>MyISAM</literal> type.
+ To convert a non-<literal>InnoDB</literal> table to use
+ <literal>InnoDB</literal> use <literal role="stmt">ALTER
+ TABLE</literal>:
</para>
- <para>
- If you want all your (non-system) tables to be created as
- <literal>InnoDB</literal> tables, you can simply add the line
- <literal>default-storage-engine=innodb</literal> to the
- <literal>[mysqld]</literal> section of your server option file.
- </para>
+<programlisting>
+ALTER TABLE t1 ENGINE=InnoDB;
+</programlisting>
+ <important>
+ <para>
+ Do not convert MySQL system tables in the
+ <literal>mysql</literal> database (such as
+ <literal>user</literal> or <literal>host</literal>) to the
+ <literal>InnoDB</literal> type. This is an unsupported
+ operation. The system tables must always be of the
+ <literal>MyISAM</literal> type.
+ </para>
+ </important>
+
<para>
<literal>InnoDB</literal> does not have a special optimization
for separate index creation the way the
@@ -2407,12 +2415,18 @@
<xref linkend="forcing-recovery"/>.
</para>
+ <para>
+ If you want all your (non-system) tables to be created as
+ <literal>InnoDB</literal> tables, add the line
+ <literal>default-storage-engine=innodb</literal> to the
+ <literal>[mysqld]</literal> section of your server option file.
+ </para>
+
</section>
<section id="innodb-auto-increment-handling">
- <title>How <literal>AUTO_INCREMENT</literal> Handling Works in
- <literal>InnoDB</literal></title>
+ <title><literal>AUTO_INCREMENT</literal> Handling in <literal>InnoDB</literal></title>
<para>
Beginning with MySQL 5.1.22, <literal>InnoDB</literal> provides
@@ -8535,13 +8549,13 @@
<listitem>
<para>
When troubleshooting, it is usually best to run the MySQL
- server from the command prompt, rather than through the
- <command>mysqld_safe</command> wrapper or as a Windows
- service. You can then see what <command>mysqld</command>
- prints to the console, and so have a better grasp of what is
- going on. On Windows, you must start the server with the
- <filename>--console</filename> option to direct the output to
- the console window.
+ server from the command prompt, rather than through
+ <command>mysqld_safe</command> or as a Windows service. You
+ can then see what <command>mysqld</command> prints to the
+ console, and so have a better grasp of what is going on. On
+ Windows, start <command>mysqld</command> with the
+ <option>--console</option> option to direct the output to the
+ console window.
</para>
</listitem>
Modified: trunk/refman-6.0/se-innodb-core.xml
===================================================================
--- trunk/refman-6.0/se-innodb-core.xml 2008-11-05 22:01:15 UTC (rev 12297)
+++ trunk/refman-6.0/se-innodb-core.xml 2008-11-05 22:01:26 UTC (rev 12298)
Changed blocks: 7, Lines Added: 55, Lines Deleted: 41; 7671 bytes
@@ -958,12 +958,13 @@
<para>
It is best to run the MySQL server <command>mysqld</command>
from the command prompt when you first start the server with
- <literal>InnoDB</literal> enabled, not from the
- <command>mysqld_safe</command> wrapper or as a Windows service.
- When you run from a command prompt you see what
- <command>mysqld</command> prints and what is happening. On Unix,
- just invoke <command>mysqld</command>. On Windows, use the
- <option>--console</option> option.
+ <literal>InnoDB</literal> enabled, not from
+ <command>mysqld_safe</command> or as a Windows service. When you
+ run from a command prompt you see what <command>mysqld</command>
+ prints and what is happening. On Unix, just invoke
+ <command>mysqld</command>. On Windows, start
+ <command>mysqld</command> with the <option>--console</option>
+ option to direct the output to the console window.
</para>
<para>
@@ -2134,9 +2135,10 @@
<literal>InnoDB</literal> tablespace by issuing a
<literal role="stmt">SHOW TABLE STATUS</literal> statement for any
<literal>InnoDB</literal> table. The amount of free space in the
- tablespace appears in the <literal>Comment</literal> section in
- the output of <literal role="stmt">SHOW TABLE STATUS</literal>.
- For example:
+ tablespace appears in the <literal>Data_free</literal> section in
+ the output of <literal role="stmt">SHOW TABLE STATUS</literal> (or
+ the <literal>Comment</literal> section prior to MySQL 6.0.5). For
+ example:
</para>
<programlisting>
@@ -2159,11 +2161,11 @@
with autocommit mode enabled, which automatically commits every
SQL statement as you execute it. To use multiple-statement
transactions, you can switch autocommit off with the SQL
- statement <literal>SET AUTOCOMMIT = 0</literal> and use
- <literal>COMMIT</literal> and <literal>ROLLBACK</literal> to
- commit or roll back your transaction. If you want to leave
- autocommit on, you can enclose your transactions within
- <literal>START TRANSACTION</literal> and either
+ statement <literal>SET AUTOCOMMIT = 0</literal> and end each
+ transaction with either <literal>COMMIT</literal> or
+ <literal>ROLLBACK</literal>. If you want to leave autocommit on,
+ you can begin your transactions within <literal>START
+ TRANSACTION</literal> and end them with
<literal>COMMIT</literal> or <literal>ROLLBACK</literal>. The
following example shows two transactions. The first is
committed; the second is rolled back.
@@ -2172,24 +2174,24 @@
<programlisting>
shell> <userinput>mysql test</userinput>
-mysql> <userinput>CREATE TABLE CUSTOMER (A INT, B CHAR (20), INDEX (A))</userinput>
+mysql> <userinput>CREATE TABLE customer (a INT, b CHAR (20), INDEX (a))</userinput>
-> <userinput>ENGINE=InnoDB;</userinput>
Query OK, 0 rows affected (0.00 sec)
mysql> <userinput>START TRANSACTION;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>INSERT INTO CUSTOMER VALUES (10, 'Heikki');</userinput>
+mysql> <userinput>INSERT INTO customer VALUES (10, 'Heikki');</userinput>
Query OK, 1 row affected (0.00 sec)
mysql> <userinput>COMMIT;</userinput>
Query OK, 0 rows affected (0.00 sec)
mysql> <userinput>SET AUTOCOMMIT=0;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>INSERT INTO CUSTOMER VALUES (15, 'John');</userinput>
+mysql> <userinput>INSERT INTO customer VALUES (15, 'John');</userinput>
Query OK, 1 row affected (0.00 sec)
mysql> <userinput>ROLLBACK;</userinput>
Query OK, 0 rows affected (0.00 sec)
-mysql> <userinput>SELECT * FROM CUSTOMER;</userinput>
+mysql> <userinput>SELECT * FROM customer;</userinput>
+------+--------+
-| A | B |
+| a | b |
+------+--------+
| 10 | Heikki |
+------+--------+
@@ -2212,24 +2214,30 @@
<section id="converting-tables-to-innodb">
- <title>Converting <literal>MyISAM</literal> Tables to <literal>InnoDB</literal></title>
+ <title>Converting Tables from Other Storage Engines to
+ <literal>InnoDB</literal></title>
<para>
- Important: Do not convert MySQL system tables in the
- <literal>mysql</literal> database (such as
- <literal>user</literal> or <literal>host</literal>) to the
- <literal>InnoDB</literal> type. This is an unsupported
- operation. The system tables must always be of the
- <literal>MyISAM</literal> type.
+ To convert a non-<literal>InnoDB</literal> table to use
+ <literal>InnoDB</literal> use <literal role="stmt">ALTER
+ TABLE</literal>:
</para>
- <para>
- If you want all your (non-system) tables to be created as
- <literal>InnoDB</literal> tables, you can simply add the line
- <literal>default-storage-engine=innodb</literal> to the
- <literal>[mysqld]</literal> section of your server option file.
- </para>
+<programlisting>
+ALTER TABLE t1 ENGINE=InnoDB;
+</programlisting>
+ <important>
+ <para>
+ Do not convert MySQL system tables in the
+ <literal>mysql</literal> database (such as
+ <literal>user</literal> or <literal>host</literal>) to the
+ <literal>InnoDB</literal> type. This is an unsupported
+ operation. The system tables must always be of the
+ <literal>MyISAM</literal> type.
+ </para>
+ </important>
+
<para>
<literal>InnoDB</literal> does not have a special optimization
for separate index creation the way the
@@ -2308,12 +2316,18 @@
<xref linkend="forcing-recovery"/>.
</para>
+ <para>
+ If you want all your (non-system) tables to be created as
+ <literal>InnoDB</literal> tables, add the line
+ <literal>default-storage-engine=innodb</literal> to the
+ <literal>[mysqld]</literal> section of your server option file.
+ </para>
+
</section>
<section id="innodb-auto-increment-handling">
- <title>How <literal>AUTO_INCREMENT</literal> Handling Works in
- <literal>InnoDB</literal></title>
+ <title><literal>AUTO_INCREMENT</literal> Handling in <literal>InnoDB</literal></title>
<para>
<literal>InnoDB</literal> provides a locking strategy that
@@ -8388,13 +8402,13 @@
<listitem>
<para>
When troubleshooting, it is usually best to run the MySQL
- server from the command prompt, rather than through the
- <command>mysqld_safe</command> wrapper or as a Windows
- service. You can then see what <command>mysqld</command>
- prints to the console, and so have a better grasp of what is
- going on. On Windows, you must start the server with the
- <filename>--console</filename> option to direct the output to
- the console window.
+ server from the command prompt, rather than through
+ <command>mysqld_safe</command> or as a Windows service. You
+ can then see what <command>mysqld</command> prints to the
+ console, and so have a better grasp of what is going on. On
+ Windows, start <command>mysqld</command> with the
+ <option>--console</option> option to direct the output to the
+ console window.
</para>
</listitem>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r12298 - in trunk: . refman-4.1 refman-5.0 refman-5.1 refman-6.0 | paul.dubois | 5 Nov |