MySQL Databases

Discussion in 'PHP' started by AimyThomas, Sep 12, 2012.

  1. #1
    How do you guys backup your MySQL databases?

    I have a few programs that have an default back up that make an .sql file which is great but I also use OpenX which runs on PHP and has a database. That does not have an auto-back-up feature so do I just download the database and that's it?

    Any recommend for the tool?

    Thanks
     
    AimyThomas, Sep 12, 2012 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,899
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    I have a paid version of sqlyog and through that I have daily batch files backing up my sites.
     
    sarahk, Sep 13, 2012 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    xtrabackup and I do daily with Navicat.
     
    jestep, Sep 13, 2012 IP
  4. mbaldwin

    mbaldwin Active Member

    Messages:
    215
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    95
    #4
    I use to use phpmysqlautobackup on my non-word press sites.
     
    mbaldwin, Sep 13, 2012 IP
  5. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #5
    To Import SQL file
    mysql -u USER -p DBNAME < dump.sql

    To Backup to SQL file
    mysqldump -u USER -p DBNAME > dump.sql
     
    NetStar, Sep 14, 2012 IP
  6. greyinfotech

    greyinfotech Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I prefer mysqldump as it is owned my mysql itself so for me it is the most authenticated tool.
    It is command line and some time takes more time but it is worthy.
    For simple backup like for a one or few table mysql also has its own command as follow


    $query = "SELECT * INTO OUTFILE $filename FROM $tablename";
     
    greyinfotech, Sep 18, 2012 IP
  7. zacharooni

    zacharooni Well-Known Member

    Messages:
    346
    Likes Received:
    20
    Best Answers:
    4
    Trophy Points:
    120
    #7
    mysqldump preferred here also, and for InnoDB add --single-transaction --opt to your mysqldump options
     
    zacharooni, Sep 18, 2012 IP