List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:June 28 2001 6:57pm
Subject:Re: Inserting values into table
View as plain text  

Jon Haworth wrote:

> Hi list,
> 
> Sorry if this appears twice, our mail server is playing up at the moment.
> 
> We've got an sql file that was created using mysqldump on an NT box. The
> info in this file needs to be imported into MySQL on a Linux box. When I run
> 
>    /usr/local/mysql/bin/mysql < /home/jon/dump.sql

/usr/local/mysql/bin/mysql foo < /home/jon/dump.sql

You might be loading into table foo of a different database than you think.


> 
> I get "Error 1062 at line 50: duplicate entry '1' for key 1".
> 
> 
> The guilty area of the sql file looks like this:
> 

alternately add here:

use foo;



> CREATE TABLE foo (
> 	ID int(10) unsigned NOT NULL auto_increment,
> 	Tag varchar(50) NOT NULL default '',
> 	Category varchar(50) NOT NULL default '',
> 	PRIMARY KEY (ID)
> ) TYPE=MyISAM;
> 
> INSERT INTO foo VALUES (1,'some text','some more text'); /* line 50! */
> INSERT INTO foo VALUES (2,'some text','some more text'); 
> INSERT INTO foo VALUES (3,'some text','some more text'); 
> ....etc
> 
> 
> The /usr/local/mysql/data/foo directory is empty, all I've done is enter
> "create database foo" into the mysql console.
> 
> Aaargh! What am I missing? This sql file was created by MySQL and I haven't
> altered it apart from putting a "USE MyDatabase" line at the top.
> 
> Any ideas?
> 
> 
> Cheers
> Jon
> 
> 
> 
> 
> 
> 
> _______________________________________________________
>  Get 100% private, FREE email for life from Excite UK
>  Visit http://inbox.excite.co.uk/ 
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <mysql-thread77938@stripped>
> To unsubscribe, e-mail
> <mysql-unsubscribe-gerald_clark=suppliersystems.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-- 
Gerald L. Clark
gerald_clark@stripped

Thread
Inserting values into tableJon Haworth28 Jun
  • Re: Inserting values into tableGerald Clark28 Jun