如何检查MySQL中表字段上是否存在索引?

时间:2020-03-06 14:39:43  来源:igfitidea点击:

我已经需要Google几次,所以我要分享我的问题。

解决方案

像这样使用SHOW INDEX

SHOW INDEX FROM [tablename]

文件:https://dev.mysql.com/doc/refman/5.0/en/show-index.html

只是从cli看表布局。你会做

desc mytable

或者

show table mytable