Restoring MySQL backup

Discussion in 'MySQL' started by amanamission, May 1, 2008.

  1. #1
    Stupid question, I know, but the database on my PHP toplist is broken and I can't put it together again. The error is crashing my site. I deleted the offending table, but I can't seem to replace it with the DB from my backup, whether I upload or cut-and-paste.
    I have a backup from late October, but if I import the data, it gives me errors, telling me "Table already exists." How I can override this?
    At this point, all I want is to have my backup in place and get the site live again.
    How do I do this with PHP myadmin?
     
    amanamission, May 1, 2008 IP
  2. kashem

    kashem Banned

    Messages:
    1,250
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can drop all the tables and try to restore
     
    kashem, May 1, 2008 IP
    amanamission likes this.
  3. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #3
    You can add the if exist drop statement.

    Off the top of my head I don't recall the exact syntax.

    If you have a full back up the other option is drop all the tables and leave just the em,pty database. If I were doing this I would export what I still have first, just in case.
     
    Colbyt, May 1, 2008 IP
    amanamission likes this.
  4. amanamission

    amanamission Notable Member

    Messages:
    1,936
    Likes Received:
    138
    Best Answers:
    0
    Trophy Points:
    210
    #4
    Thanks folks-mission accomplished. Rep for all!
     
    amanamission, May 1, 2008 IP