ALTER TABLE without locking the table?

后端 未结 19 2043
梦毁少年i
梦毁少年i 2020-11-30 17:41

When doing an ALTER TABLE statement in MySQL, the whole table is read-locked (allowing concurrent reads, but prohibiting concurrent writes) for the duration of the statement

19条回答
  •  借酒劲吻你
    2020-11-30 18:08

    You should definitely try pt-online-schema-change. I have been using this tool to do migrations on AWS RDS with multiple slaves and it has worked very well for me. I wrote an elaborate blog post on how to do that which might be helpful for you.

    Blog: http://mrafayaleem.com/2016/02/08/live-mysql-schema-changes-with-percona/

提交回复
热议问题