Tudor
Tudor

Reputation: 1181

Will mysql transactions rollback after system crash?

My question baliscally is: if the sytem crashes right when a mysql transaction is executed, will the transaction rollback after system restart?

How are the transactions executed by mysql?

Will MySQL check for unfinished transactions after restart?

I'm asking this because I made a transaction system in php, but I'm not storing the final results anywhere for a future rollback in case of a system crash...

Upvotes: 3

Views: 1662

Answers (2)

ypercubeᵀᴹ
ypercubeᵀᴹ

Reputation: 115600

There are different kind of crashes. The MySQL server can crash (like if you kill it) or the whole Operating system can crash (like if you unplug the machine).

Where you should start reading is about the Binary Log and how it works and about the Recovery process for InnoDB engine

Upvotes: 2

Mithun Sasidharan
Mithun Sasidharan

Reputation: 20950

Yes definitely you can roll back. Refer the DOC for more details

Upvotes: 1

Related Questions