简体   繁体   中英

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM