The world's most popular open source database
In InnoDB, all user activity occurs inside a
transaction. If autocommit mode is enabled, each SQL statement
forms a single transaction on its own. By default, MySQL starts
new connections with autocommit enabled.
If autocommit mode is disabled within a session with
SET AUTOCOMMIT = 0, the session always has a
transaction open. An SQL COMMIT
or ROLLBACK
statement ends the current transaction and a new one starts. A
COMMIT means that the changes
made in the current transaction are made permanent and become
visible to other sessions. A
ROLLBACK
statement, on the other hand, cancels all modifications made by
the current transaction. Both
COMMIT and
ROLLBACK
release all InnoDB locks that were set during
the current transaction.
If the session has autocommit enabled, a multiple-statement
transaction can be performed by starting it with an explicit
START
TRANSACTION or
BEGIN
statement and ending it with
COMMIT or
ROLLBACK.


User Comments
To see what autocommit is set to you can:
mysql> select @@autocommit;
To set the default behaviour for all incoming connections, add the following into your my.cnf or my.ini:
[mysqld]
init_connect='set autocommit=0'
WARNING: this sets autocommit to 0 for ALL connections, not just the command-line client!
Keep in mind that some calls will Auto-commit and end the transaction, even if autocommit is disabled. For example, CREATE TABLE.
http://dev.mysql.com/doc/refman/5.0/en/implicit-commit.html
Add your own comment.