For MySQL 5.5.8 or above version:

 configure in configuration my.cnf file:

 

[mysqld] autocommit=0


Before 5.5.8, due to mysql has no global variables autocommit 

use workaround in my.cnf:

 

[mysqld]
init_connect='SET autocommit=0'

 

But the workaround has a limitation , The content of init_connect is not executed for users that have the SUPER privilege.

 

 

Below is the original description from Manual  book:

http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_init_connect

--------------------------------------Clip begin--------------------------------------------------

init_connect

Command-Line Format --init-connect=name
Option-File Format init_connect
Option Sets Variable Yes, init_connect
Variable Name init_connect
Variable Scope Global
Dynamic Variable Yes
  Permitted Values
Type string

A string to be executed by the server for each client that connectsThe string consists of one or more SQLstatementsseparated by semicolon charactersFor exampleeach client session begins by default withautocommit mode enabledFor older servers (before MySQL 5.5.8), there is no global autocommit system variable to specify that autocommit should be disabled by default, but as a workaround init_connect can be used to achieve the same effect:

SET GLOBAL init_connect='SET autocommit=0';

The init_connect variable can also be set on the command line or in an option fileTo set the variable as justshown using an option fileinclude these lines:

[mysqld]
init_connect='SET autocommit=0'

The content of init_connect is not executed for users that have the SUPER privilegeThis is done so that anerroneous value for init_connect does not prevent all clients from connectingFor examplethe value mightcontain a statement that has a syntax errorthus causing client connections to failNot executing init_connectfor users that have the SUPER privilege enables them to open a connection and fix the init_connect value.

--------------------------------------Clip End--------------------------------------------------