tags:

views:

23

answers:

3

i have user table, i have 5 records ,

i delete two records , then executed the rollback command, rollback command executed successfully.

But that deleted two records not recovered ,

user table engine is innodb...

+3  A: 

By default, MySQL starts the session for each new connection with autocommit enabled,

You could set autocommit mode disable before running your query

SET autocommit=0;

ref:

  1. http://dev.mysql.com/doc/refman/5.0/en/innodb-transaction-model.html
  2. http://dev.mysql.com/doc/refman/5.0/en/innodb-transactions-with-different-apis.html
S.Mark
not working....for me... i tried as per dev-mysql-support
Bharanikumar
A: 

make sure you already do command start transaction;

before query delete

cmiiw

no idea about this...how to do the command start transaction...
Bharanikumar
+1  A: 
SET autocommit=0;
BEGIN;
.
.
.
ROLLBACK;

http://dev.mysql.com/doc/refman/5.0/en/commit.html

Emil Vikström