当前位置:网站首页>MySQL basic tutorial -- MySQL transaction and storage engine
MySQL basic tutorial -- MySQL transaction and storage engine
2022-06-12 00:06:00 【Code tapping Xiaolang】
List of articles
One 、 What is business ?

-- An important concept and specific operation of transaction
-- demonstration
-- 1. Create a test table
CREATE TABLE t27
( id INT,
`name` VARCHAR(32));
-- 2. Start business
START TRANSACTION
-- 3. Set the savepoint
SAVEPOINT a
-- perform dml operation
INSERT INTO t27 VALUES(100, 'tom');
SELECT * FROM t27;
SAVEPOINT b
-- perform dml operation
INSERT INTO t27 VALUES(200, 'jack');
-- Back to b
ROLLBACK TO b
-- Keep going back a
ROLLBACK TO a
-- If so , It means to directly back to the start of the transaction .
ROLLBACK
COMMIT

Two 、 Business details

-- 1. If you don't start a transaction , By default ,dml Operations are automatically submitted , Cannot be rolled back
INSERT INTO t27 VALUES(300, 'milan'); -- Automatic submission commit
SELECT * FROM t27
-- 2. If you start a transaction , You didn't create a savepoint . You can execute rollback,
-- The default is to go back to the beginning of your transaction
START TRANSACTION
INSERT INTO t27 VALUES(400, 'king');
INSERT INTO t27 VALUES(500, 'scott');
ROLLBACK -- Indicates the state of directly backing back to the beginning of the transaction
COMMIT;
-- 3. You can also be in this business ( Before it's submitted ), Create multiple savepoints . such as : savepoint aaa;
-- perform dml , savepoint bbb
-- 4. You can do this before the transaction is committed , Choose which savepoint to go back to
-- 5. InnoDB Storage engine support transactions , MyISAM I won't support it
-- 6. Start a transaction start transaction, set autocommit=off;
3、 ... and 、 Transaction isolation level




Four 、MySQL Business ACID

5、 ... and 、 Storage engine overview



Reference resources b Station hanshunping teacher video :https://www.bilibili.com/video/BV1H64y1U7GJ
边栏推荐
- 環境搭建2
- Class. Getresource() and class Getresourceasstream() method
- [day 5 of JUC learning] reference atomic classes and attribute modifiers
- Jenkins of the integrate tool
- [flume] notes
- Redis的主从复制、哨兵模式和集群
- Balanced binary tree (AVL tree)
- CD process
- (linear DP | monotone queue) acwing 895 Longest ascending subsequence
- Read the 23 steps of the enterprise through the financial report
猜你喜欢

【JUC系列】Executor框架之概览

Jenkins基本配置

(linear DP) acwing 898 Number triangle
![将数组分成和相等的三个部分[问题分析]](/img/0b/856fcceb0373baa8acb46e9ae2c861.png)
将数组分成和相等的三个部分[问题分析]

自定义JSP标签->概念->生命周期

On the knowledge points of cookie attributes and the differences between webstorage and cookies?

Pass the command parameters for operating mongodb to Mongo in the shell
![Divide the array into three equal parts [problem analysis]](/img/0b/856fcceb0373baa8acb46e9ae2c861.png)
Divide the array into three equal parts [problem analysis]

(dp+ longest common subsequence) acwing 897 Longest common subsequence

voc数据格式转为coco数据格式
随机推荐
Jenkins basic configuration
Display product details [project mall]
DPT-FSNET: DUAL-PATH TRANSFORMER BASED FULL-BAND AND SUB-BAND FUSION NETWORK FOR SPEECH ENHANCEMENT
Lake Shore - supertran continuous flow cryogenic thermostat system
Antigen products enter the family, and Chinese medical device enterprises usher in a new blue ocean
New Year Countdown JS case
Integrate工具之Jenkins
[pat (basic level) practice] - [simple simulation] 1076 WiFi password
Graph and graph traversal
SAP SD 创建/修改价格表
挂载smb共享提示目录无权限
通过财报读懂企业的23个步骤
二叉排序树
Unified certification center oauth2 high availability pit
图及图的遍历
Redis master-slave replication, sentinel mode and cluster
win10文件夹状态红叉表示的是什么
Achievements in science and Technology (XV)
Balanced binary tree (AVL tree)
Mathematical modeling experience ----- summary of three modeling