use the -f option to ignore the duplicates. Chris Barnes wrote:
>Hi, >I have a database which a few tables which have a few fields set with >auto_increment and i'm having alot of trouble restoring the backup because >the backup recreates the table with the auto_increment field, but when it >tries to enter the data back into the table it cant because it is trying to >manually enter the value for the field with the auto_increment. > >here's a sample of the backup sql... > >CREATE TABLE ships ( > ship_id bigint(20) unsigned NOT NULL auto_increment, > ship_name varchar(20), > ship_destroyed enum('Y','N') DEFAULT 'N' NOT NULL, > character_name varchar(20) DEFAULT '' NOT NULL, > password varchar(16) DEFAULT '' NOT NULL, > >now here's a sample of the data it will try to enter into the table.... > ># Dumping data for table 'ships' ># > >LOCK TABLES ships WRITE; >INSERT INTO ships VALUES (1,'WebMaster','N','WebMaster','admin@xxxxxxxxxx'); >UNLOCK TABLES; > >if i try to restore the database from this data it always tells me there was >an error because it is trying to insert a duplicate value. > >dos anyone know how to properly backup and restore a table with >auto_increment fields? or am i on the completely wrong track here? > >any help appreciated. > > > >--------------------------------------------------------------------- >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 <[EMAIL PROTECTED]> >To unsubscribe, e-mail ><[EMAIL PROTECTED]> >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --------------------------------------------------------------------- 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 <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php