简体   繁体   中英

Mysql: ALTER TABLE without locking the table?

I want to add column to an existing table.

Is there a manner to alter the table without locking it?

No, that's not possible.

However, adding a nullable column or a not null column with a constant (immutable) default value is merely a catalog change and only takes a very short time (typically "milliseconds" if the lock can be obtained). But during that time, the exclusive lock can't be avoided.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM