1

I have a table named google. When I call SHOW CREATE TABLE google; I get:

CREATE TABLE `google` (
   `index` bigint(20) DEFAULT NULL,
   `name` text,
   `rating` double DEFAULT NULL,
   `address` text,
   `price` text,
   KEY `ix_google_index` (`index`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci

I can see the name of index is index. I've tried to delete it using

ALTER TABLE google Drop INDEX 'index';
ALTER TABLE google DROP INDEX;
ALTER TABLE google DROP INDEX index;
ALTER TABLE google DROP INDEX `index`;

None of them seem to work. How can I delete it?

haneulkim
  • 4,406
  • 9
  • 38
  • 80
  • I forgot to mention I've also tried that and didn't work. – haneulkim Apr 23 '19 at 03:48
  • You're using the wrong name. it should be `DROP INDEX \`ix_google_index\``. Sorry, I should have read your question more closely. Anyway here's a demo: https://dbfiddle.uk/?rdbms=mysql_5.7&fiddle=29cb5a4e189b4ce82e59d227cf08a314 – Nick Apr 23 '19 at 03:51

0 Answers0