Home > Database > Mysql Tutorial > How to start mysql transaction

How to start mysql transaction

WBOY
Release: 2023-05-31 17:58:06
forward
1156 people have browsed it

1. Explicitly start transaction statements, begin or start transaction, submit commit, and rollback.

2. Set autocomit=0, this command will automatically close this thread. As long as the select statement is executed, the transaction will start and will not be automatically committed until comit or rollback is actively executed or the connection is disconnected.

Example

------------
TRANSACTIONS
------------
 
---TRANSACTION 906574, ACTIVE 383 sec
1 lock struct(s), heap size 1136, 0 row lock(s), undo log entries 1
MySQL thread id 71, OS thread handle 139874604435200, query id 9040045 172.17.0.1 server_234
Copy after login

The above is the detailed content of How to start mysql transaction. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template