mysql事务操作

1、事务开启提交:

begin;

insert into table values(1, 'one', 'two');

commit;

2、事务开启回滚:

begin;

insert into table values(1, 'one', 'two');

rollback;

3、事务保存点:

begin;

savepoint s1;

insert into table values(1, 'one', 'two');

savepoint s2;

insert into table values(2, 'one', 'two');

roolback s2;(s2后面的语句全部失效)

原文地址:https://www.cnblogs.com/Fmaj7/p/13593664.html