MySQL database rollback method after misoperation, mysql database
Basically, Every programmer dealing with databases (or perhaps your colleagues) will have a problem. How can I roll back MySQL quickly after a misoperation? For example, if you delete
Basically, every programmer working with the database (and probably your colleagues) will have a problem, how to quickly rollback after MySQL misoperation? For example, delete a table, forget to limit the condition, the whole table is gone. If this
Add by Zhj: It seems that my understanding of MySQL has yet to be deepened, the water is still quite deep ah, MySQL to record lock, you can set the time-out through the innodb_lock_wait_timeout parameter,If the lock waits longer than this time, it
In MYSQL, only INNODB and BDB Data Tables support transaction processing! Other types are not supported! * **: The default MYSQL database engine is MyISAM, which does not support transactions! If you want MYSQL to support transactions, You can
The method is as follows:
1. Modify the C:appservmysqlmy.ini file, find the Skip-innodb, add the # in front, and save the file.2. In operation input: services.msc, restart the MySQL service.3. In phpMyAdmin, mysql->show engines; (or perform
Start transaction, commit and rollback syntaxStart Transaction | Begin [Work]commit [Work] [and [No] chain] [[No] release]rollback [work] [and [No] chain] [[No] release]set autocommit = { 0 | The 1}start transaction or BEGIN statement can begin a
The entire transaction can be written or revoked using a simple ROLLBACK and COMMIT statement with a reserved point. However, just for simple transactions to do this, more complex transactions may require partial commit or fallback. For example, the
You can actually see the inserted record in the current transaction. At last it was only deleted. However, Auto_increment should not delete and change the value.
1, why auto_increament did not roll back?
Because the current value of the InnoDB's
thinkphp transaction rollback processing and the original PHP transaction rollback instance, thinkphp instance
1. To support transactions within the program, the first connected database and data table must support the transaction MySQL for example:
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.