Home > Database > Mysql Tutorial > body text

How to modify the index type in mysql

青灯夜游
Release: 2022-04-14 19:50:35
Original
7732 people have browsed it

Mysql method to modify the index type: 1. Use the "DROP INDEX index name ON table name;" statement to delete the original specified index; 2. Use "CREATE index type keyword INDEX index name ON table name (column Name [length])" statement creates an index with the same name to modify the type.

How to modify the index type in mysql

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

There is no direct instruction to modify the index in MySQL. Generally, we need to delete the original index first, and then create an index with the same name as needed, so as to modify the index in disguise.

mysql Modify index type

#1. Delete the original index

When the index is no longer needed , you can use the DROP INDEX statement to delete the index.

Grammar format:

DROP INDEX <索引名> ON <表名>
Copy after login

The syntax description is as follows: