PrefaceThis article mainly introduces how to start a transaction in MySQL. You can also refer to the official documentation for related information. https://dev.mysql.com/doc/refman/8.0/en/commit.html Method 1START TRANSACTION or BEGIN starts a new transaction COMMIT commits the current transaction ROLLBACK rolls back the current transaction This is a well-known method, in which the methods of starting a transaction, start transaction and begin, are the same. Method 2SET autocommit = 0; By default, autocommit = 1, which means that transactions are automatically committed. From the screenshot, we can see that there is a transaction in progress. Because set autocommit = 0; is set, the subsequent update operation will not modify the result, and other sessions will not be able to check it (RR level). At this time, you need to manually execute commit. Note that autocommit has not been changed. At this time, the autocommit value is still 0, which means that subsequent SQL statements of this session need to be committed manually. This is the end of this article about how to start a transaction in MySQL. For more information about starting a transaction in MySQL, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Vue implements nested routing method example
>>: Docker deployment MySQL8 cluster (one master and two slaves) implementation steps
You can go to the Ubuntu official website to down...
MySQL binary installation method Download mysql h...
A Multi-Select is a UI element that lists all opt...
[LeetCode] 183.Customers Who Never Order Suppose ...
1. First look at the request configuration file, ...
Table of contents TOKEN Timer Refresher 2. Intern...
Table of contents 1. Problem description: 2. Trou...
Preface This is an investigation caused by the ex...
1. Overview of DDL Atomicity Before 8.0, there wa...
MySQL 5.5 installation and configuration method g...
First, let’s look at the GIF operation: Case 1: S...
Table of contents animate() animation method Anim...
Why is it stuck? There is a premise that must be ...
Preface In database operations, in order to effec...
Table of contents Opening scene Direct rendering ...