By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

Can't delete any foreign key on every query to drop foreign key

P: 1
mysql> alter table employee_salary drop foreign key empid;
ERROR 1025 (HY000): Error on rename of '.\hjj\employee_salary' to '.\hjj\#sql2-16c-1' (errno: 152)
plz solve this
Dec 12 '12 #1
Share this Question
Share on Google+
2 Replies


100+
P: 126
check if the name of foreign key you mentioned is correct
Dec 12 '12 #2

100+
P: 126
use the following query to known the name of the foreign key
Expand|Select|Wrap|Line Numbers
  1. SHOW CREATE TABLE table_name
you can also use the constraint name rather than the column name of the foreign key
Dec 12 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.