首页 > 数据库 > MySQL > mysql里alter table 重定义主键的步骤:

mysql里alter table 重定义主键的步骤:

原创 MySQL 作者:rainbowbridg 时间:2012-05-25 18:14:55 0 删除 编辑
Processing CREATE INDEXConsider an example. If you use the ALTER TABLE command to
redefine the primary key of table T (or otherwise cause the clustered index to be recreated, for example by compressing an uncompressed table),
the InnoDB Plugin will perform the following sequence of steps:

Lock table T in exclusive mode.
Create a new temporary table T1, with the new index structure.
Copy data from table T to temporary table T1.
Rename the original table T to temporary table T2.
Rename table T1 (the new table) to T (the original table name).
Drop table T2 (the original table, with the old index structure).

来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
  • 博文量
  • 访问量