Results 1 to 4 of 4
  1. #1

    Who can help me? mySQL restore problem?

    I upload a mysql backup file (dump) to my server . around 350MB

    and then I want to restore this file and using this command


    mysql -p<db.sql

    but I don't know what reason, my backup have some sytax error
    or some little mistake. when restore progress find out which line
    have some error, it will popup a error message and stop.
    the only way I know how to do is find out the erroe line,fix or
    delete it, then start to restore again!!

    MY QUESTION IS:
    Does any one can tell me how to restore mySQL backup file and
    can skip or avoid the error message. When restore progress
    find out a error, it will sikp it and go to the next line and continue
    to the end

  2. #2
    Is it the same type of error each time?

    If so you could try and fix all the errors in the file, perhaps with a search and replace or a perl script.
    Adnan.
    FusionRays.com
    Shared and Reseller Plans

  3. #3
    I know I can just fix it, but it is too slow
    Every time the restore progess stop because one line or certain
    line haveing error. then I have to correct and restart it.
    the point is restart, I have to empty all the data it restore
    before, because certain line contains error then restart to
    restore .

    In this situation, how many error equal to how manay times
    I have to restart. but you know , my file is 350MB, it will take me
    too................................................long

    so I need to find out a way can just simply skip that error line
    ,go to next line and DON'T stop the restore progess!!!!

  4. #4
    Perhaps you could post the message that you are getting here?

    In any case, you might be able to write a shell script (ugh) to iterate over the ENTIRE sql dump, line by line, and execute that line as an argument to the commandline mysql utility.

    You would then test for a return code (0=success, 1=failure). You could then log all failures and what line they were on, and have it ignore that and move on.

    It would be slow, it would be ugly, but it just might work. PM me if you need some help writing it.
    "The only difference between a poor person and a rich person is what they do in their spare time."
    "If youth is wasted on the young, then retirement is wasted on the old"

Posting Permissions

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