mysql事务

1 开始事务begin;

2 提交事务commit;

3 回滚(撤销)事务rollback;

4 代码

sql 复制代码
update student set userName='流氓+渣男' where id=5;
begin;
update student set userName='流氓da渣男' where id=5;
select * from student where id=5;
update student set userName='独臂大傻雕渣男' where id=4;
select * from student where id=4;
rollback;
commit;

5 效果图

相关推荐
安当加密2 小时前
达梦数据库TDE透明加密解决方案:构建高安全数据存储体系
网络·数据库·安全
Jabes.yang5 小时前
Java求职面试实战:从Spring Boot到微服务架构的技术探讨
java·数据库·spring boot·微服务·面试·消息队列·互联网大厂
阿巴~阿巴~6 小时前
Redis 核心文件、命令与操作指南
数据库·redis·缓存·客户端·服务端
koping_wu6 小时前
【Redis】用Redis实现分布式锁、乐观锁
数据库·redis·分布式
abcefg_h6 小时前
关系型数据库与非关系型数据库
数据库·nosql
海奥华27 小时前
SQLEXPLAIN 详解
数据库·mysql
00后程序员张7 小时前
【Python】基于 PyQt6 和 Conda 的 PyInstaller 打包工具
运维·服务器·数据库
huihuihuanhuan.xin7 小时前
后端八股之Redis
数据库·redis·缓存
情深不寿3177 小时前
MySQL————数据库基础
数据库·mysql
程序新视界7 小时前
如何选择合适的数据库?PostgreSQL与MySQL各项对比
数据库·mysql·postgresql