Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can schema changes be done within transactions in MySQL?

Tags:

mysql

That's pretty much all there is to my question: Can schema changes be done within transactions in MySQL?

My understanding is no but I'm not having an easy time finding documentation that provides a definitive answer.

like image 757
Jason Swett Avatar asked Sep 15 '25 00:09

Jason Swett


1 Answers

Implicit commit and cannot rollback sections of the mysql documentation quite clearly indicate, that schema changes should not be part of a transaction involving other commands, since they will either cause a commit, or the schema changes cannot be rolled back.

like image 50
Shadow Avatar answered Sep 17 '25 15:09

Shadow