Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysqldump/mysqlimport & autoincrement columns

Status
Not open for further replies.

disord3r

Programmer
Apr 12, 2002
189
US
My apologies if this question has already been asked/anwered. I've just spend a bit of time looking throuh the threads, and didn't find what I was looking for, so here goes.

I need to move a lot of data from one database to another. The columns in database 1 are IDENTICAL (names, types, properties) to the columns in database 2. Every table in these databases use autoincrement columns.

To get the data over from database 1 to database 2, it seems like I need to do a mysqldump/mysqlimport. The only problem is that mysqldump actually writes out the autoincrement values during the dump. If I were to use this data when I run mysqlimport, I would get a lot of "duplicate entry" messages.

So, I guess my question is this. Is there an option for mysqldump that tells it to write out 'null' in place of any of the autoincrement values, so that I don't have to go through the text file and manually change hundreds of thousands of values to 'null' just so that I can actually import it into the second database with mysqlimport?

Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top