文档介绍:mysql事务学****MySQL transaction learning)
MySQL learning notes 7 transaction backup and recovery index storage process
1. storage engine for transactions
The database has different storage and management methods for the same data, and it is called storage engine in mysql.
2. introduction mon transaction engines Myisam (Zhang Mahu) InnoDB (Li Xiaoxin)
parison:
Features Myisam InnoDB
The speed of batch insertion
Transaction security support
Full text index support
Lock mechanism, table lock, line lock
3. transaction
Popular business: refers to a group of operations,
Transactions should conform to the following characteristics:
Either A. is executed essfully, or none is executed. Atomic
Atomicity -- >
B. does not see the intermediate change before all the operations have been executed. Isolation of Isolation -- >
The C. transaction occurred before and after the data, according to the rules, the total should match the consistency -- > > consisstency
D. if transactions are wrong, transactions that have been executed are not allowed to be revoked, and can only be corrected pensating transactions. Taking a persistent durability
Synthesis for ACID
4. transaction syntax:
Open transaction: start transaction;
SQL transaction operations
....
Commit transaction: mit / rollback rollback (if the transaction is found mit, it means that the transaction statement effect before rollback is cancelled and returns to the state before the transaction is opened. Once the end mit, with a rollback rollback to previous state); not the (Note: when a mit or rollback transaction is over, if you need to re operation, need to use start transaction; open again Affairs) mit, in front of the SQL transaction does not display the results.
MySQL submit some privacy statements, these statements do not need mit will be submitted directly: such as alter function, alter procedure, alter table, begin, create database, create function, create index, start transaction (the former a transa