Closed Thread
Results 1 to 5 of 5

Thread: Backing up mysql dbs

  1. #1
    pballz is offline x10Hosting Member pballz is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    24

    Backing up mysql dbs

    I'm looking at methods to automate backing up a db. So instead of playing around and most likely getting frustrated when stuff doesn't work I'm gonna ask for advice first.

    I found this as one method of backing up a db.

    Code:
    <?php
                include 'config.php';
                include 'opendb.php';
                $backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';
                $command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
                system($command);
                include 'closedb.php';
    ?>
    But I've read sometimes the mysqldump command is turned off so I was wondering if anyone could tell if this would work. Also any other methods of backing up a db would be greatly appreciated.

  2. #2
    calistoy's Avatar
    calistoy is offline Free Support Volunteer calistoy is just really nice
    Join Date
    Aug 2008
    Location
    USA
    Posts
    5,598

    Re: Backing up mysql dbs

    Go to phpMyAdmin and use the export function to export a backup copy of your database.

  3. #3
    pballz is offline x10Hosting Member pballz is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    24

    Re: Backing up mysql dbs

    I said I want to automate backing it up. Going to phpmyadmin isn't that automated. Do people read and try to understand before replying?

  4. #4
    stpvoice's Avatar
    stpvoice is offline Community Support Rep stpvoice has a brilliant futurestpvoice has a brilliant futurestpvoice has a brilliant future
    Join Date
    Dec 2008
    Location
    United Kingdom
    Posts
    5,939

    Re: Backing up mysql dbs

    Quote Originally Posted by pball_inuyasha
    I said I want to automate backing it up. Going to phpmyadmin isn't that automated. Do people read and try to understand before replying?
    Please don't be rude, or you won't get any help.

    There's also phpMyBackupPro, which is automated I believe. We have a wiki article about it here: http://x10hosting.com/wiki/PhpMyBackupPro
    Last edited by stpvoice; 06-15-2011 at 04:49 PM.


  5. #5
    pballz is offline x10Hosting Member pballz is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    24

    Re: Backing up mysql dbs

    Well just in case anyone ever finds this wondering the same thing. That code in the first post won't work since system() is blocked. But I did find a nice pure php script that saves a whole db to an sql file. I also made in addition a script to zip my whole site then ftp the sql backup and zipped backup. It also does email notifications.

    If anyone is interested I'll share.

Closed Thread

Similar Threads

  1. DB Backing up
    By _tlbs in forum Free Hosting
    Replies: 3
    Last Post: 06-13-2011, 11:00 PM
  2. I'm done backing up......
    By xxxhackerscammerxxx57 in forum Free Hosting
    Replies: 1
    Last Post: 02-28-2011, 06:56 AM
  3. Backing Up Files
    By DemonicDemon in forum Free Hosting
    Replies: 8
    Last Post: 02-04-2009, 06:41 AM
  4. Backing up ?
    By ~stuart~ in forum Free Hosting
    Replies: 1
    Last Post: 02-06-2008, 10:38 PM
  5. Backing up my site
    By mkstretch in forum Scripts & 3rd Party Apps
    Replies: 5
    Last Post: 09-20-2006, 05:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers