SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist J-net's Avatar
    Join Date
    Mar 2002
    Location
    Virginia
    Posts
    461
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Having a horrible time with mysql backups...

    I've been trying to backup and restore a database on my server but I'm having a terrible time with it.

    The actual mysqldump goes ok (mysqldump db_name > backup.sql).

    But, when it comes time to restore it, it keeps stopping and getting caught up on "sql syntax errors" within the dump file.

    It's a large database, I think 300mb or so, but I really don't understand why there would be errors if it's a working database.

    All I know is I am very very fed up with MySQL recently and I don't think we'll ever use it again. These kind of issues are certainly annoying, especially when it seems Mysql is at fault.
    - John
    IT Security & Networks, .NET & PHP Developer
    Business Horizons | MD Review | RNRexpo
    Personal sites: Ferrari Wallpaper | Car Wallpaper

  2. #2
    SitePoint Enthusiast textndata's Avatar
    Join Date
    Jul 2004
    Location
    New Delhi
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Jnet use

    shell> mysqldump --tab=/path/to/some/dir --opt db_name

    Or: shell> mysqlhotcopy db_name /path/to/some/dir

    You can also simply copy all table files (`*.frm', `*.MYD', and `*.MYI' files) as long as the server isn't updating anything. The mysqlhotcopy script uses this method.

    Try Try until u succeed

  3. #3
    Non-Member
    Join Date
    Aug 2002
    Location
    USA
    Posts
    544
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might have to use some of these options:

    --fields-terminated-by=...
    Fields in the textfile are terminated by ...
    --fields-enclosed-by=...
    Fields in the importfile are enclosed by ...
    --fields-optionally-enclosed-by=...
    Fields in the i.file are opt. enclosed by ...
    --fields-escaped-by=...
    Fields in the i.file are escaped by ...
    --lines-terminated-by=...
    Lines in the i.file are terminated by ...

  4. #4
    SitePoint Evangelist J-net's Avatar
    Join Date
    Mar 2002
    Location
    Virginia
    Posts
    461
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by textndata
    Hi Jnet use

    shell> mysqldump --tab=/path/to/some/dir --opt db_name

    Or: shell> mysqlhotcopy db_name /path/to/some/dir

    You can also simply copy all table files (`*.frm', `*.MYD', and `*.MYI' files) as long as the server isn't updating anything. The mysqlhotcopy script uses this method.

    Try Try until u succeed
    Can mysqlhotcopy be used to copy back over to a new database (which is what I'm trying to do)? The problem isn't getting a dump/exporting, the problem is when I go to restore it there's errors in the sql.
    - John
    IT Security & Networks, .NET & PHP Developer
    Business Horizons | MD Review | RNRexpo
    Personal sites: Ferrari Wallpaper | Car Wallpaper


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
  •