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
Preface Creating shortcuts in Linux can open appl...
html: In fact, it is to arrange several solid cir...
I personally feel that the development framework ...
Writing XHTML demands a clean HTML syntax. Writing...
Table of contents Summary put first: 🌲🌲 Preface: ...
Table of contents Breaking down components Left P...
1. Docker Network Mode When docker run creates a ...
This article example shares the specific code of ...
This article example shares the specific code of ...
This article example shares the specific code of ...
1 Introduction Kong is not a simple product. The ...
Table of contents 1. Content Overview 2. Concepts...
Table of contents JavaScript prototype chain Obje...
1. Linux installation (root user operation) 1. In...
<br />In one year of blogging, I have person...