...

View Full Version : Comparing Schemas



rfresh
05-13-2011, 08:58 PM
I was comparing two databases and noticed the only differences was in the AUTO_INCREMENT=xxx part at the end. As shown below this table has an auto_increment of 600 and in the other table it's a different value.

The two databases are supposed to be the same as one site is my development site and the other site is my production site.

I don't understand what the AUTO_INCREMENT=xxx part is defining and why it would have different values for tables which are supposed to be the same?

Do I need to manually sync these two values so they are the same?



CREATE TABLE IF NOT EXISTS `Phone_Numbers` (
`id` int(11) NOT NULL auto_increment,
`company_index` int(11) NOT NULL default '0',
`phone_number` varchar(16) NOT NULL,
PRIMARY KEY (`id`),
KEY `company_index` (`company_index`),
KEY `phone_number` (`phone_number`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=600;

Old Pedant
05-13-2011, 11:15 PM
An AUTO_INCREMENT field is one where the *database* automatically inserts a UNIQUE incremental number each time you add a record.

Unless both databases were created at the same time and *ALL* the records were inserted into both of them *IN THE SAME ORDER*, then of course the auto_number field values will be different.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum