Error on import
| User, date | Message |
|---|---|
|
Written by markzzz
2 years ago Category: Import/Export 10 posts since Mon, 25 Apr 11 |
I try to import my DB (exported from the mysql server online, with phpMyAdmin) on HeidiSql 6.0, when I get this error : SQL Error (1062) : Duplicate entry '1' for key 1 What does it means? And 1062 is the line of the file .sql (with or without comment)? |
|
Written by ansgar
2 years ago 4018 posts since Fri, 07 Apr 06 |
No, 1062 is the error message id. "Duplicate entry" means you are trying to insert a new row with a unique or primary key which already exists. |
|
Written by markzzz
2 years ago 10 posts since Mon, 25 Apr 11 |
How can I see which table has this duplicate id? |
|
Written by markzzz
2 years ago 10 posts since Mon, 25 Apr 11 |
Uhm, now I see the log in the bottom : -- -- Dump table `categories` -- INSERT INTO `categories` (`id`, `name`, `user`, `date`) VALUES(1, 'K-Bal Sound System', 'djfonplaz', '0000-00-00 00:00:00'); /* SQL Error (1062): Duplicate entry '1' for key 1 */ And this is the whole table : CREATE TABLE IF NOT EXISTS `categories` ( `id` int(11) unsigned NOT NULL auto_increment, `name` varchar(255) NOT NULL, `user` varchar(255) NOT NULL, `date` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; -- -- Dump dei dati per la tabella `categories` -- INSERT INTO `categories` (`id`, `name`, `user`, `date`) VALUES(1, 'K-Bal Sound System', 'djfonplaz', '0000-00-00 00:00:00'); INSERT INTO `categories` (`id`, `name`, `user`, `date`) VALUES(2, 'Network23 Mixtapes', 'djfonplaz', '0000-00-00 00:00:00'); INSERT INTO `categories` (`id`, `name`, `user`, `date`) VALUES(3, 'Artskorps Webmix', 'djfonplaz', '0000-00-00 00:00:00'); INSERT INTO `categories` (`id`, `name`, `user`, `date`) VALUES(4, 'GTW Users Mixes', 'djfonplaz', '0000-00-00 00:00:00'); INSERT INTO `categories` (`id`, `name`, `user`, `date`) VALUES(5, 'Underground Music Tapes', 'djfonplaz', '0000-00-00 00:00:00'); INSERT INTO `categories` (`id`, `name`, `user`, `date`) VALUES(6, 'UK Main Events', 'djfonplaz', '0000-00-00 00:00:00'); INSERT INTO `categories` (`id`, `name`, `user`, `date`) VALUES(7, 'Gabba Nation, Bunker & Box, German Events', 'djfonplaz', '0000-00-00 00:00:00'); ? |
|
Written by markzzz
2 years ago 10 posts since Mon, 25 Apr 11 |
Uhm! done:) I wrong to select the DB before insert all data |
|
Please login to leave a reply, or register at first. |