C_Neth
C_Neth

Reputation: 746

MySQL "ALTER IGNORE TABLE" Error In Syntax

I am trying to run the query:

ALTER IGNORE TABLE test_table DROP PRIMARY KEY, ADD PRIMARY KEY(id);

test_table is just a temporary table I'm using for testing purposes, and id is a column in it.

The query works fine without the "IGNORE" key word, but when I add it I get the error message:

"Error Code: 1064. 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 'IGNORE TABLE test_table ADD PRIMARY KEY(id)' at line 1"

How do I fix this? Or how can I run that query and ignore any errors that might occur? Thanks!

Upvotes: 6

Views: 5449

Answers (1)

Thanga
Thanga

Reputation: 8161

As of MySQL 5.7.4, the IGNORE clause for ALTER TABLE is removed and its use produces an error. Please check your version

Upvotes: 10

Related Questions