MySQL control (Off, open) automatic submission function, mysql submit

Source: Internet
Author: User

MySQL control (Off, open) automatic submission function, mysql submit

When executing commands in MySQL, it is usually determined that the command is submitted directly. That is to say, the user does not need to be aware of this issue, and all commands will be automatically COMMIT. Especially when the storage engine is MyISAM, it does not support transaction processing. As long as the command is executed, all command departments will be submitted.

This default automatic submission function is called the automatic submission function. The automatic submission function is set to ON by default. However, if the storage engine is InnoDB, it will not be automatically submitted after the start transaction or BEGIN command (MySQL TRANSACTION processing-rollback after deletion) is executed, it is submitted only after the COMMIT command is explicitly executed. Before that, You can execute the ROLLBACK command to roll back the update operation.

You can set the automatic submission function to OFF. In this way, the user will not be submitted after executing the SQL statement, but will only be submitted after executing the COMMIT command, and the ROLLBACK command will be executed.

The following describes the syntax for setting the automatic submission function to ON and OFF.

Set the automatic submission function to ON

Set the automatic submission function to OFF.

We will demonstrate what changes will happen after the automatic submission function is set to OFF. If it is set to OFF, we insert a piece of data into the table user to see if rollback is possible.

Set the automatic submission function to OFF. The execution result is as follows.

View data in table user

MySQL automatic submission function (2)

Article source WEB programming http://www.uphtm.com, reproduced please indicate the source: http://www.uphtm.com/database/188.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.