InnoDB Transaction Model experience with other database systems, where it is standard practice to issue a sequence of DML statements and commit them or roll them back all together. To use multiple-statement transactions, switch autocommit off with the SQL statement  SET autocommit = 0  and end each transaction with  COMMIT  or  ROLLBACK  as appropriate. To leave autocommit on, begin each transaction with  START TRANSACTION  and end it with  COMMIT  or  ROLLBACK . The following example shows two transactions. The first is committed; the second is rolled back. shell>  mysql test 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  COMMIT  to the MySQL server as strings just like any other SQL statements such as  SELECT  or  INSERT . Some APIs also offer separate special transaction commit and rollback functions or methods. A consistent read means that  InnoDB  uses multi-versioning to present to a query a snapshot of the database at a point in time. The query sees the changes made by transactions that committed before that point in time, and no changes made by later or uncommitted transactions. The exception to this rule is that the query sees the changes made by earlier statements within the same transaction. This exception causes the following anomaly: If you update some rows in a table, a  SELECT  sees the latest version of the updated rows, but it might also see older versions of any rows. If other sessions simultaneously update the same table, the anomaly means that you might see the table in a state that never existed in the database. If the transaction isolation level is  REPEATABLE READ  (the default level), all consistent reads within the same transaction read the snapshot established by the first such read in that transaction. You can get a fresher snapshot for your queries by committing the current transaction and after that issuing new queries. 3089 15.7.2.3 Consistent Nonlocking Reads Transactions in Client-Side Languages mysql>  CREATE TABLE customer (a INT, b CHAR (20), INDEX (a)); Query OK, 0 rows affected (0.00 sec) mysql>  -- Do a transaction with autocommit turned on. 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>  -- Do another transaction with autocommit turned off. 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>  INSERT INTO customer VALUES (20, ’Paul’); Query OK, 1 row affected (0.00 sec) mysql>  DELETE FROM customer WHERE b = ’Heikki’; Query OK, 1 row affected (0.00 sec) mysql>  -- Now we undo those last 2 inserts and the delete. 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>