Creating And Using Innodb Tables - Oracle 5.0 Reference Manual

Table of Contents

Advertisement

from the binary log. However, it is also the slowest choice (unless the disk has a battery-backed
cache, which makes synchronization very fast).
14.2.3. Creating and Using
To create an
CREATE TABLE customers (a INT, b CHAR (20), INDEX (a)) ENGINE=InnoDB;
The older term
the preferred term and
The statement creates a table and an index on column
data files that you specified in my.cnf. In addition, MySQL creates a file
directory under the MySQL database directory. Internally,
data dictionary. The entry includes the database name. For example, if
the
customers
table of the same name
InnoDB.
You can query the amount of free space in the
statement for any
section in the output of
SHOW TABLE STATUS FROM test LIKE 'customers'
The statistics
optimization. Table and index reserved sizes in bytes are accurate, though.
14.2.3.1. How to Use Transactions in
By default, each client that connects to the MySQL server begins 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
end each transaction with either
begin your transactions within
following example shows two transactions. The first is committed; the second is rolled back.
shell>
mysql test
mysql>
CREATE TABLE customer (a INT, b CHAR (20), INDEX (a))
->
ENGINE=InnoDB;
Query OK, 0 rows affected (0.00 sec)
mysql>
START TRANSACTION;
Query OK, 0 rows affected (0.00 sec)
mysql>
INSERT INTO customer VALUES (10, 'Heikki');
Query OK, 1 row affected (0.00 sec)
mysql>
COMMIT;
Query OK, 0 rows affected (0.00 sec)
mysql>
SET autocommit=0;
Query OK, 0 rows affected (0.00 sec)
mysql>
INSERT INTO customer VALUES (15, 'John');
Query OK, 1 row affected (0.00 sec)
mysql>
ROLLBACK;
Query OK, 0 rows affected (0.00 sec)
mysql>
SELECT * FROM customer;
+------+--------+
| a
| b
+------+--------+
|
10 | Heikki |
+------+--------+
1 row in set (0.00 sec)
mysql>
In APIs such as PHP, Perl DBI, JDBC, ODBC, or the standard C call interface of MySQL, you can send
transaction control statements such as
Creating and Using
InnoDB
table, specify an
InnoDB
is supported as a synonym for
TYPE
is deprecated.
TYPE
table is created, the entry is for 'test/customers'. This means you can create a
customers
table. The amount of free space in the tablespace appears in the
InnoDB
SHOW TABLE
displays for
SHOW
InnoDB
COMMIT
START TRANSACTION
|
Tables
InnoDB
Tables
ENGINE = InnoDB
ENGINE
in the
a
InnoDB
in some other database, and the table names do not collide inside
tablespace by issuing a
InnoDB
STATUS. For example:
tables are only approximate. They are used in SQL
with Different APIs
InnoDB
or ROLLBACK. If you want to leave autocommit on, you can
and end them with
to the MySQL server as strings just like any other SQL
COMMIT
1254
option in the
CREATE TABLE
for backward compatibility, but
tablespace that consists of the
InnoDB
customers.frm
adds an entry for the table to its own
is the database in which
test
SHOW TABLE STATUS
SET autocommit = 0
or ROLLBACK. The
COMMIT
statement:
is
ENGINE
in the
test
Comment
and

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Mysql 5.0

Table of Contents