Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将我的 mysql 5.5 数据库中几个表的 varchar 列从 15 个字符扩大到 20 个字符。在更改表查询期间表是否会被锁定/不可用,类似于添加/删除列?
有问题的表有几百万行。
文档(存储、性能和并发考虑部分)说,表在被更改时应该仍然是可读的,但是写入将被推迟到ALTER TABLE完成。所以它会阻止写入,但不会阻止读取。
ALTER TABLE