Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Three minutes to understand mysql transaction knowledge

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly gives you a brief talk about the knowledge of mysql affairs. You can look up the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here. Let's go straight to the topic. I hope this article on the knowledge of mysql transactions can bring you some practical help.

Mysql transaction

Transaction: a set of atomic SQL queries, or a single unit of work

ACID Test:

A:atomicity, atomicity: all operations in the entire transaction are either performed successfully or all failed and rolled back.

C:consistency, consistency: a database always transitions from one consistency state to another

I:Isolation, isolation; actions made by one firm cannot be seen by others until they are submitted

D:durability: persistence. Once a transaction commits, its changes are permanently saved in the database.

Transaction:

Start transaction, START TRANSACTION

End the transaction:

1.COMMIT

2.ROLLBACK

Recommendation: display request and commit transactions instead of using the autocommit feature

Autocommit 0

3. Transactions support savepoint

SAVEPOINT identifier

ROLLBACK [WORK] TO [SAVEPOINT] identifier

RELEASE SAVEPOINT identifier

4. Transaction isolation level:

Show global variables like 'tx_%'

READ-UNCOMMITED (read uncommitted): you can read changes that have not been committed in another session

READ-COMMITED (read submission): the content submitted by the other party can not be read until another session is submitted.

REPEATABLE-READ (rereadable): another session can only read previous data before it commits itself, whether it commits or not.

SERIALIZABILE (serializable): if you do not submit it yourself, the modification of the corresponding data will be blocked.

Mysql transaction knowledge will first tell you here, for other related issues you want to know can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report