Check to see if MySQL table field exists

1137475 pts.
Tags:
MySQL
Would it be possible for me to check to see if a specific index exists on a MySQL table field? What command do I have to use?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can use the SHOW INDEX command.

In this case, it would be something like this:

SHOW INDEX FROM your_table_name WHERE column_name = ‘<your column name>’;

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • carlosdl
    Comments by CharlieBrowne:

    "Thanks for coming to ITKE

    Your question was already asked at this site. Here is a link: https://itknowledgeexchange.techtarget.com/itanswers/how-to-check-if-a-table-exists-in-mysql-without-throwing-an-exception/"

    I removed it from the Answer Wiki, as the question linked to by Charlie is about checking if a table exists, which is not really what is asked here.
    84,720 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: