Show indexes for a table with MySQL

by Rekha 2010-01-28 13:54:22

MySQL has a SQL query "SHOW INDEX FROM" which returns the indexes from a table.This query is used to get a list of indexes and a list of primary keys for a table with MySQL.

Syntax:
SHOW INDEXES FROM table_name;

Show the primary keys

To just show the primary key for the table run this query:

SHOW INDEXES FROM table_name WHERE Key_name = "PRIMARY";

Tagged in:

1012
like
0
dislike
0
mail
flag

You must LOGIN to add comments