6

I have searched the web but I have failed to find a conclusive answer for this question.

Is there any difference between CREATE INDEX and ALTER TABLE ADD INDEX?

Are there any problems that may arise when I use one or the other or do both work the same way?

Server version: 5.5.32 - MySQL Community Server (GPL)

Paul White
  • 83,961
  • 28
  • 402
  • 634
Kyad
  • 71
  • 2
  • 4

1 Answers1

5

The CREATE INDEX syntax requires an index name, whereas the ALTER TABLE ADD INDEX syntax doesn't.

This question as already been asked and answered and should be marked as a duplicate.

Glorfindel
  • 2,201
  • 5
  • 17
  • 26
Tom Desp
  • 537
  • 2
  • 14
  • I have created an event, but when the execution time reaches, the column in the database is not update. What causes this? – Kyad Apr 02 '16 at 10:36