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