MySQL "ALTER IGNORE TABLE" Syntax Error

I am trying to run a query:

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

test_table is just a temporary table that I use for testing purposes, and id is a column.

The query works fine without the "IGNORE" keyword, but when I add it, I get an error:

"Error code: 1064. You have an error in the SQL syntax, check the manual that matches the version of your MySQL server for the correct syntax to use next to" IGNORE TABLE test_table ADD PRIMARY KEY (id) "on line 1"

How to fix it? Or how can I run this request and ignore any errors that may occur? Thanks!

+5
source share
1 answer

Starting in MySQL 5.7.4, the IGNORE clause for ALTER TABLE is removed and its use causes an error. Check your version

+9
source

Source: https://habr.com/ru/post/1241344/


All Articles