Home  >  Article  >  Database  >  How to close transaction in mysql

How to close transaction in mysql

青灯夜游
青灯夜游Original
2022-06-20 15:39:375774browse

Mysql steps to close transactions: 1. Use the "win r" key to open the "Run" window, enter cmd and press Enter to open the cmd command window; 2. In the cmd window, execute "mysql -u root -p" command and enter the password to log in to the mysql service and enter the MySQL interface; 3. In the MySQL command interface, execute the "start transaction;" or "Set autocommit = 0;" command to close the transaction.

How to close transaction in mysql

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

MySQL automatically commits transactions by default, so how to close the transaction? Take a look below.

Mysql steps to close transactions

1. Use the "win r" key to open the "Run" window, enter cmd and press Enter to open cmd command window

How to close transaction in mysql

How to close transaction in mysql

2. In the cmd command window, execute "mysql -u root -p" Command and enter the password to log in to the mysql service and enter the MySQL interface

How to close transaction in mysql

After entering the MySQL interface, the interface window will change to the following display

How to close transaction in mysql

3. In the MySQL command interface, execute the command to close the transaction

start transaction;

How to close transaction in mysql

or

Set autocommit = 0;

How to close transaction in mysql

Extension Knowledge: If you want to enable automatic submission, you only need to execute submit or Set autocommit= 1;.

How to close transaction in mysql

[Related recommendations: mysql video tutorial]

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

Statement:
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