Wednesday , 25 November 2020
Stackode
Home > MySql > How to delete index in MySql

How to delete index in MySql

How to delete index in MySql, first you need to know the exact name of the INDEX (Unique key in this case) to delete or update it. INDEX names are usually same as column names. In case of more than one INDEX applied on a column, MySQL automatically suffixes numbering to the column names to create unique INDEX names.

For example if 2 indexes are applied on a column named customer_id

  1. The first index will be named as customer_id itself.
  2. The second index will be names as customer_id_2 and so on.

To know the name of the index you want to delete or update

SHOW INDEX FROM <table_name>

To delete an index

ALTER TABLE <table_name> DROP INDEX <index_name>;

Thank u.  😆

Ref : stackoverflow

 

About Whendy

Whendy Blog mengumpulkan beberapa Tutorial Website, PHP, AngularJS, JQuery, Laravel, Codeigniter dan lain-lain. ( jika sempat ) :)

Check Also

Where Clause – SQL

Where Clause – SQL is used to specify a condition while fetching the data from ...

Leave a Reply

Your email address will not be published. Required fields are marked *