[SOLVED] auto_increment

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
comtek
Forum Commoner
Posts: 39
Joined: Tue Feb 17, 2004 10:46 pm

[SOLVED] auto_increment

Post by comtek »

Can you change the auto_increment default value after data has been entered? When I created the table I did not specify a default value.

I have since removed all data from the table,
Deleted the field and re-created,
but if set the default to say 10000, it goes thru with no errors, but when I go back to check there is nothing in the default column and new records start back at 0.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the next auto_increment value is stored outside the table's normal structure, in it's properties.

viewtopic.php?t=26552
comtek
Forum Commoner
Posts: 39
Joined: Tue Feb 17, 2004 10:46 pm

Post by comtek »

Doesn't seem to do it...

I tried setting it at the MySQL command line using the command you refered me to. I've also tried using phpmyadmin... no luck It goes thru like its supposed to but the value is not there when you go back and look at the table config.

This table is a InnoDB and the field is a PK and also a FK in another table, but there is no data in the other table.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

there is no change to the table's config. Only it's properties.

The change is reflected in the "operations" tab of the table in question while under phpMyAdmin. The change must be done to the table where the key originates I'd imagine.
comtek
Forum Commoner
Posts: 39
Joined: Tue Feb 17, 2004 10:46 pm

Post by comtek »

OK took another staba t it tonight and the command line that you refered me too worked.

Thanks for the help.. you do a great job.
Post Reply