Home >Database >Mysql Tutorial >How to delete the auto-incrementing primary key in mysql
How to delete the auto-increment primary key in mysql: First, you need to delete auto_increment; then execute the [alter table data table name drop primary key;] statement to delete the primary key.
Deleting the primary key in MySQL requires the following two steps
(Recommended tutorial: mysql video tutorial)
(1) If there is auto_increment, delete it first;
(2) Delete the primary key constraint primary key
alter table t9 modify id int(11); #这里用的modify,只改变数据类型,也可以用change,改变列名的同时输入新的数据类型。 alter table t9 drop primary key; #删除主键
Related recommendations: mysql tutorial
The above is the detailed content of How to delete the auto-incrementing primary key in mysql. For more information, please follow other related articles on the PHP Chinese website!