Get the App
SLTechnology News&Howtos  ›  Database  › 

The method of removing Primary key constraint by mysql

Shulou Source: shulou.com Published: 2022-06-01 02:57:14 10月28日 Update

Editor to share with you how mysql removes primary key constraints. I hope you will gain a lot after reading this article. Let's discuss it together.

Mysql removes the primary key constraint by first executing the [Alter table tb change id id int (10);] command to delete self-growth, and then executing the [Alter table tb drop primary key;] command to delete the primary key.

First delete self-growth

Alter table tb change id id int (10); / / delete self-growth

Then delete the primary key

Alter table tb drop primary key;// delete the main construction finished reading this article, I believe you have a certain understanding of mysql to remove primary key constraints, want to know more related knowledge, welcome to follow the industry information channel, thank you for reading!

Tags: Methods growth commands articles done more knowledge industry information information channels channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Linux NVidia MySQL Docker