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后面的语句全部失效)

 

posted @ 2020-08-31 23:18  Fmaj-7  阅读(85)  评论(0编辑  收藏  举报