How to drop foreign key in innodb table?
ALTER TABLE locations1 DROP FOREIGN KEY fk_locations1(id); is this correct?
Asked
Active
Viewed 71 times
1

13ruce1337
- 753
- 1
- 6
- 13

user3308965
- 41
- 1
- 6
-
1Nope, that key has a name, just use that name (`DROP FOREIGN KEY fk_locations1;` most likely, if not, check your `SHOW CREATE TABLE` output for how the index is called). – Wrikken Mar 15 '14 at 22:48
-
You will find a solution for your problem in this SO response: http://stackoverflow.com/a/14122155/3388491 – oschlueter Mar 15 '14 at 22:48
-
Beside reading the manual (a good answer for this question is RTFM) I have PHPMYADMIN where I do such stuff and it shows me the command it used. Saves the time to look it up in the manual. – Itay Moav -Malimovka Mar 15 '14 at 22:56