Restoring dump(backup): ERROR 1022 (23000) at line 44: Can't write; duplicate key in table
0
votes
1
answer
1287
views
I'm doing tests to change a current table from my InnoDB database to Archive, but I had a problem trying to restore a dump after the change.
After several tests, the problem is related to the value declared in the AUTO_INCREMENT attribute in CREATE TABLE. But this script is created automatically.
How can I fix this error so that I can restore the dump quickly without having to change it?
...
--
-- Table structure for table
tabela
--
DROP TABLE IF EXISTS tabela
;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE tabela
(
cd_tabela
int(11) NOT NULL AUTO_INCREMENT,
...
PRIMARY KEY (tabela
)
) ENGINE=ARCHIVE AUTO_INCREMENT=3081487 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table tabela
--
LOCK TABLES tabela
WRITE;
/*!40000 ALTER TABLE tabela
DISABLE KEYS */;
INSERT INTO tabela
VALUES (1,...), ... (in this line the error appears)
...
Asked by Matheus Sant Anna de Oliveira
(131 rep)
Jan 26, 2018, 04:45 PM
Last activity: Mar 3, 2025, 06:05 PM
Last activity: Mar 3, 2025, 06:05 PM