Home>Article>Database> How to remove primary key constraints in mysql

How to remove primary key constraints in mysql

王林
王林 Original
2020-09-30 14:41:51 11771browse

Mysql method to remove primary key constraints: First execute the [Alter table tb change id id int(10);] command to delete the auto-increment; then execute the [Alter table tb drop primary key;] command to delete the primary key.

How to remove primary key constraints in mysql

First delete the self-increase

(Recommended tutorial:mysql tutorial)

Alter table tb change id id int(10);//删除自增长

Then delete Primary key

Alter table tb drop primary key;//删除主建

Related recommendations:php training

The above is the detailed content of How to remove primary key constraints in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn