-1

I try to fix some error in Jira as mention in this page but when I try to run an SQL query, I got the below error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CONSTRAINT fk_ao_8542f1_ifj_obj_attr_val_object_attribute_id' at line 1

My Query is:

ALTER TABLE AO_8542F1_IFJ_OBJ_ATTR_VAL 
DROP CONSTRAINT `fk_ao_8542f1_ifj_obj_attr_val_object_attribute_id`

How I can fix this Query? I use MySQL version 5.7

4
  • Please show us the create table statement for your table. Commented Sep 30, 2020 at 10:48
  • I want to use the "Insight" plugin in Jira and those tables create by plugin Commented Sep 30, 2020 at 10:53
  • 1
    Does this answer your question? How to remove constraints from my MySQL table? Commented Sep 30, 2020 at 11:02
  • No @GSerg, unfortunately not working for me! Commented Sep 30, 2020 at 11:44

2 Answers 2

2

Drop MySQL foreign key constraints To drop a foreign key constraint, you use the ALTER TABLE statement:

ALTER TABLE table_name 
DROP FOREIGN KEY constraint_name;
Sign up to request clarification or add additional context in comments.

Comments

1

Judging by the name of the constraint, I believe it's a foreign key and MySQL has a different approach to drop foreign keys:

ALTER TABLE AO_8542F1_IFJ_OBJ_ATTR_VAL
DROP FOREIGN KEY `fk_ao_8542f1_ifj_obj_attr_val_object_attribute_id`

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.