Database questions

Discussion in 'Site & Server Administration' started by fryman, Mar 10, 2005.

  1. #1
    2 websites use the same script. Site A has 10 tables, site B has 20 tables.

    I go to site B and do a database backup from the cpanel.

    Then go to site A and restore the backup.

    What will happen? Will site A end up with 30 tables? Will the old tables get deleted and end up with 20 tables?
     
    fryman, Mar 10, 2005 IP
  2. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #2
    It depends on the mysqldump command line args. If you told it to use "drop tables", then you will get whatever the source DB had in the target DB where the table names match, non matching tables will be created as new tables.

    If you excluded the drop table commands and there are tables in the target DB with the same names as the source DB, the mysql restore will fail with a table exists error.
     
    noppid, Mar 10, 2005 IP