SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Upload contents of one mysql db into another?

    Hi-- is it possible to upload contents of one mysql db into another, newly created db with a different number of fields without error? The first db has 10 fields and the second one I would like to move the contents to has two additional fields. The 10 fields in each match, but of course the first one doesn't have 12 fields. I want to do this because often my client will want to add or take away a field and I can't seem to do it without getting an error and of course I want to keep the records. The db gets its entries from a submit form.
    Opportunity favors the prepared mind.

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,426
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    I would suspect you could do a mysqldump to export and then import your data. I think you won't get any errors. The two new fields will be empty, though.

  3. #3
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stymiee
    I would suspect you could do a mysqldump to export and then import your data. I think you won't get any errors. The two new fields will be empty, though.
    Oh good, thank you. Just trying to troubleshoot in advance.
    Opportunity favors the prepared mind.

  4. #4
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    make sure you specify complete inserts when dowing the export, otherwise you will get errors.

  5. #5
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,426
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Chri
    Oh good, thank you. Just trying to troubleshoot in advance.
    That's the way to do it. Spending a few minutes (or more) planning it out will save you a lot of time and headaches later.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •