Error on import

[expired user #5677]'s profile image [expired user #5677] posted 13 years ago in Import/Export Permalink
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)?
ansgar's profile image ansgar posted 13 years ago Permalink
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.
[expired user #5677]'s profile image [expired user #5677] posted 13 years ago Permalink
How can I see which table has this duplicate id?
[expired user #5677]'s profile image [expired user #5677] posted 13 years ago Permalink
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');

?
[expired user #5677]'s profile image [expired user #5677] posted 13 years ago Permalink
Uhm! done:) I wrong to select the DB before insert all datasmileThanks anyway

Please login to leave a reply, or register at first.