Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2004
    Location
    Behind You.
    Posts
    692

    Trying to restore a 250 mb MYSQL DB...

    Hi guys,
    I'm trying to restore a 250 mb mysql file and I can't seem to do it.

    I uploaded the file named mysql.sql into the directory /home/USERNAME/public_html/ using ftp.

    I logged into shell, root, and did:

    cd /home/USERNAME/public_html/

    mysql DATABASE -uUSERNAME -pPASSWORD < mysql.sql

    and it went for like 10 minutes then came back with an error at line 1789, lost connection to mysql server during query.

    I've tried this three times now and every time it loses the connection, it inputs like 15 megs of data then quits. Then when I run it again, I have to empty the table because it says it already exists.

    This is a backup from a friend, so he can't make the backup again for me with "drop tables" or anything like that, that is usually how I make backups with extended quotes and everything so I never have to deal with crap like this.

    How can I fix this and restore the database fully?

  2. #2
    Join Date
    May 2003
    Location
    Heartland, USA
    Posts
    733
    Is there an equiv to the dump's --opt on the command line?
    You've got to accentuate the positive; Eliminate the negative
    Latch on to the affirmative; Don't mess with Mister In-Between

    -Bob

  3. #3
    Join Date
    Dec 2004
    Location
    Behind You.
    Posts
    692
    since i don't understand what your saying, i'll have to say no there isn't on the command line.

    mysql DATABASE -uUSERNAME -pPASSWORD < mysql.sql

    That is the command i used (replacing DATABASE, USERNAME, PASSWORD with real ones)

  4. #4
    You have to check what is at line 1789 and probably remove or change it depending upon your mysql version.

  5. #5
    Join Date
    Dec 2004
    Location
    Behind You.
    Posts
    692
    ok, only problem is how do i scroll a text file that is 258 mb in size? and how can I find line 1789 fast or fix this problem?

    I ran it again this time, and the database size went to 89 megs this time, last time i only got 14 mb, so the problem isn't at that line, it's that when it cancels or TIMES OUT, and i try to resume ( I don't know how to resume, i just used the same command )

    Anyway I can resume?

  6. #6
    Join Date
    Apr 2005
    Location
    Cochin
    Posts
    2,446
    1. go to /var/lib/mysql/databasename (has to be the default path)
    2 . rm -f *


    Now attempt the restore process once again. If there is an error on any line number

    1. vi mysql.sql
    2. press esc button
    3 type shift + : (colon)
    4. type in the line number and press enter

    you will reach the line instantly. Check the synrqax of the line and remove it if necesary.

Posting Permissions

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