![]() |
how do i add ID's to an existing mysql database?
I have this huge database and want to assign a unique number to every record.. how can i do this?
If i create a new field and set it autoincrement it will start counting for new entries how do i adjust the old entries? |
How about edit?
|
they should already have an id.....maybe i'm just misunderstanding something
|
Quote:
When you alter the table and add a new field, those previous records default to null - where he wants them to get a prepopulated ID from the alter table command. Or something like that. |
This is the only solution I could readily think of.
Your original table: "table1 ( name, value )" make a new table with the new ID column set to auto_increment: "table2 ( id, name, value)" then run a select into table type query: INSERT INTO table2 (name,value) SELECT * from table1 |
google for "MySQL front" its the shit
|
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html
or download and install http://www.phpmyadmin.net/home_page/index.php |
All times are GMT -7. The time now is 03:22 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123