Home > Database > Mysql Tutorial > How to remove primary key constraints in mysql

How to remove primary key constraints in mysql

王林
Release: 2020-09-30 14:41:51
Original
11878 people have browsed it

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);//删除自增长
Copy after login

Then delete Primary key

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template