1、用来维护数据库的完整性,保证成批的sql语句操作成功,如有问题则全部失败;
2、事务使用的前提
innodb支持
myisam不支持
术语 tansaction rollback commit savepoint
3、演示事务效果
select * from customers2;
start transaction;
delete from customers2;
select * from customers2;
rollback;
1、用来维护数据库的完整性,保证成批的sql语句操作成功,如有问题则全部失败;
2、事务使用的前提
innodb支持
myisam不支持
术语 tansaction rollback commit savepoint
3、演示事务效果
select * from customers2;
start transaction;
delete from customers2;
select * from customers2;
rollback;