Jump to content


Photo

export and import looses auto_incremement or "extra" field values


  • Please log in to reply
4 replies to this topic

#1 mojito

mojito
  • Members
  • PipPipPip
  • Advanced Member
  • 74 posts

Posted 26 July 2006 - 09:51 PM

Why is it that this very serious oversight isnt well documented. I mean I'm struggling like hell to understand why my sites break and then have to go through every single table to manually add auto increment to the field "extra".

I export correctly with complete inserts and the other things but this never works. Incidentally I have to export to a lower version to avoid sql errors. Is this the problem?

I would prefer to do it command line but not all hosts allow ssh in to their db.

grrrrrr....Would appreciate some understanding on this thanks.

PS there is no link to a forum on mysqlfreaks.com

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 27 July 2006 - 03:41 PM

I'm not sure what you mean... complete inserts is the data, auto_increment is part of the table definition.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 mojito

mojito
  • Members
  • PipPipPip
  • Advanced Member
  • 74 posts

Posted 27 July 2006 - 05:47 PM

so then its the table definition which is being incorectly written. I may post below an example of the sql for a table.

DROP TABLE IF EXISTS `default_classlistingsdb`;
CREATE TABLE `default_classlistingsdb` (
  `classlistingsdb_id` int(11) NOT NULL auto_increment,
  `class_id` int(11) NOT NULL default '0',
  `listingsdb_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`classlistingsdb_id`),
  KEY `idx_classlistingsdb_class_id` (`class_id`),
  KEY `idx_classlistingsdb_listingsdb_id` (`listingsdb_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

-- 
-- Dumping data for table `default_classlistingsdb`
-- 

INSERT INTO `default_classlistingsdb` VALUES (1, 1, 1);
INSERT INTO `default_classlistingsdb` VALUES (2, 2, 2);

I can see the auto increment value above, so it looks like it is being ignored.

For some reason it seems to be working now, but im not crazy and it did this a previous encounter a month ago, and i ended up manually putting in the auto_increment.
?

#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 27 July 2006 - 07:04 PM

That will work just fine (as it did on my 4.1.13a box)... I can't imagine why it's being "ignored" in your case.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#5 mojito

mojito
  • Members
  • PipPipPip
  • Advanced Member
  • 74 posts

Posted 27 July 2006 - 08:00 PM

Thanks anyway fenway, I will post anything of interest on this, will no doubt come across it again.
c




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users