Home  >  Article  >  Database  >  How to delete unique constraint in mysql

How to delete unique constraint in mysql

藏色散人
藏色散人Original
2021-12-02 15:41:0510100browse

Mysql method to delete unique constraints: 1. Use the "alter table table name drop index constraint name;" syntax to delete; 2. Just delete the index index directly.

How to delete unique constraint in mysql

The operating environment of this article: Windows 7 system, Mysql version 5.7.14, Dell G3 computer.

How to delete a unique constraint in mysql?

Mysql deletes a unique constraint:

The unique constraint is also an index.

Therefore, when deleting the constraint, use the alter syntax to delete the index:

alter table 表名 drop index 约束名;

Or delete the index index directly.

Recommended learning: "mysql video tutorial"

The above is the detailed content of How to delete unique constraint 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