Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: mysql backup

  1. #1

    mysql backup

    Hello, need some simple advice, here is the thing:
    I need to back up mysql database and I plane to do it in the following manner:
    1. Dump the database into the file
    2. scp it to the ssh sevrer (from here the existing backup software will pick it up)
    The question is how do I dump mysql db to the file? (shoudl I stop mysql before dumping?)
    Thanks,.

  2. #2
    Mentor
    Join Date
    Jun 2001
    Posts
    1,672

    Re:mysql backup

    This is what I do:

    Code:
    LOCK TABLES tablename WRITE;
    FLUSH TABLES tablename;
    BACKUP TABLE tablename TO 'backupfile';
    UNLOCK TABLES;
    You would have to do this for each table in your database. I wrote a Perl script to do this automatically.

  3. #3

    Re:mysql backup

    Is there an equivalent of database dump to file command?
    (sorry, not really an mysql pro...)

  4. #4

    Re:mysql backup

    Hi,

    I went to Google and typed "backing up mysql".

    This was one of the first results I received:

    http://www.netadmintools.com/art39.html

  5. #5

    Re:mysql backup

    [quote author=cloverm link=board=4;threadid=9557;start=0#msg87019 date=1090596187]
    This is what I do:

    Code:
       LOCK TABLES tablename WRITE;
       FLUSH TABLES tablename;
       BACKUP TABLE tablename TO 'backupfile';
       UNLOCK TABLES;
    You would have to do this for each table in your database. I wrote a Perl script to do this automatically.
    [/quote]
    I thought mysql locked tables automatically, but I'm probably wrong.

  6. #6
    Senior Member
    Join Date
    Nov 2001
    Posts
    419

    Re:mysql backup

    I always use 'mysqldump' as trickster posted. Works flawlessly. You can even specify '--no-data' to leave that crap behind.

  7. #7

    Re:mysql backup

    [quote author=trickster link=board=4;threadid=9557;start=0#msg87255 date=1091012304]
    Hi,

    I went to Google and typed "backing up mysql".

    This was one of the first results I received:

    http://www.netadmintools.com/art39.html
    [/quote]

    Trickster, I usually don;t ignore/neglect google searches but in this particualr case I have no clue how the mysql thing works - hence I'd rather rely on the recomendations from the user who already did that ......after all I'm thining about mysql-based NetOffice into the enterprise, so I really need to know what I'm doing here.

    P.S. I appreciate your polite way of saying 'BTFW man!'
    ;D

  8. #8

    Re:mysql backup

    [quote author=praetorian link=board=4;threadid=9557;start=0#msg87273 date=1091027493]
    I always use 'mysqldump' as trickster posted. Works flawlessly. You can even specify '--no-data' to leave that crap behind.
    [/quote

    Sorry, you're deaing with totalovercertified dummy here ;D
    Which crap exactly will I leave behind if I specify --no-data?
    Thanks.[/quote]

  9. #9

    Re:mysql backup

    [quote author=elovkoff link=board=4;threadid=9557;start=0#msg87299 date=1091047771]
    [quote author=trickster link=board=4;threadid=9557;start=0#msg87255 date=1091012304]
    Hi,

    I went to Google and typed "backing up mysql".

    This was one of the first results I received:

    http://www.netadmintools.com/art39.html
    [/quote]

    Trickster, I usually don;t ignore/neglect google searches but in this particualr case I have no clue how the mysql thing works - hence I'd rather rely on the recomendations from the user who already did that ......after all I'm thining about mysql-based NetOffice into the enterprise, so I really need to know what I'm doing here.

    P.S. I appreciate your polite way of saying 'BTFW man!'
    ;D
    [/quote]
    I did not meant to be rude. :P

  10. #10

    Re:mysql backup

    [quote author=elovkoff link=board=4;threadid=9557;start=0#msg87300 date=1091047919]
    [quote author=praetorian link=board=4;threadid=9557;start=0#msg87273 date=1091027493]
    I always use 'mysqldump' as trickster posted. Works flawlessly. You can even specify '--no-data' to leave that crap behind.
    [/quote

    Sorry, you're deaing with totalovercertified dummy here ;D
    Which crap exactly will I leave behind if I specify --no-data?
    Thanks.[/quote]
    [/quote]
    I *THINK* no data will just save the db structure, with no data.

Similar Threads

  1. MySQL Backup and Reanimation
    By Ashcrow in forum Linux - General Topics
    Replies: 3
    Last Post: 04-26-2011, 12:07 AM
  2. Automatic MySQL Backup Script
    By peter in forum Tutorials
    Replies: 1
    Last Post: 09-22-2009, 09:13 AM
  3. mysql backup
    By svar in forum Linux - General Topics
    Replies: 2
    Last Post: 01-01-2009, 07:16 AM
  4. Automatic MySQL Backup Script
    By canela in forum Programming
    Replies: 2
    Last Post: 12-20-2006, 04:59 AM
  5. MySQl backup script
    By girlygeek in forum Programming
    Replies: 5
    Last Post: 11-11-2006, 11:23 PM

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
  •