What’s the difference between using INDEX vs KEY in MySQL?

There’s no difference. They are synonyms.

From the CREATE TABLE manual entry:

KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY can
also be specified as just KEY when given in a column definition. This was
implemented for compatibility with other database systems.

Leave a Comment