Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL "ALTER IGNORE TABLE" Error In Syntax

Tags:

mysql

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!

like image 934
C_Neth Avatar asked Jan 24 '16 05:01

C_Neth


1 Answers

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

like image 65
Thanga Avatar answered Nov 14 '22 18:11

Thanga