From 61b7213dc9179de0c49ac1bc352a9448b08cc404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=AE=8F=E8=BE=BE?= <2657224306@qq.com> Date: Thu, 19 Oct 2023 21:40:15 +0800 Subject: [PATCH] =?UTF-8?q?1019=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1019.md" | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 "48 \351\251\254\345\256\217\350\276\276/1019.md" diff --git "a/48 \351\251\254\345\256\217\350\276\276/1019.md" "b/48 \351\251\254\345\256\217\350\276\276/1019.md" new file mode 100644 index 0000000..e8785bf --- /dev/null +++ "b/48 \351\251\254\345\256\217\350\276\276/1019.md" @@ -0,0 +1,38 @@ +###### 查看全部系统 show variables ; + +show variables like 'autocommit' 查看事务状态; + +rollback;回滚 + +当autocommit 为1 或 on 时,系统会将你的增删改自动提交; + +2.关闭自动提交 + +set autocommit =off/ 0 + +3.开启自动提交 + +set autocommit = on/1 + +4.提交事务 + +commit; + +5.不管autocommit 是什么状态,临时开启一个业务 + +start transaction;从这行开始直到rollback 或commit 结束 + +savepoint P1 保存点;设置某部分图标 + +delete from emp where id = 2; + +rollback to p1; + +表示从保存点往后的所有回滚; + +6,开启一个只读事务 + +start taransaction read only; + +事务的4个特性:原子性,一致性,隔离性,持久性; + -- Gitee