Vi. Business
- Transactions are supported in MySQL only for databases or tables that use the InnoDB database engine
- Transactions can be used to maintain the integrity of the database, to ensure that a batch of SQL statements are either all executed or not executed
- Transactions are used to manage insert,update,delete statements
6.1 Features of the transaction:
- 1. atomicity of a transaction: a set of transactions, either successful or withdrawn.
- 2, stability : There is illegal data (foreign key constraints and the like), transaction recall.
- 3. Isolation: The transaction runs independently. The result of one transaction affects other transactions, and then other transactions are recalled. The 100% isolation of a transaction requires a sacrifice of speed.
- 4, reliability: After the hardware and software crashes, the INNODB data table driver will use the log file to reconstruct the changes.
Using transactions in the MySQL console to manipulate
begin ; Insert into Values (555); rollback;
Of course, if the above data is not a problem, enter commit to submit the command on the line;
python-database MySQL