Jump to content

Backup MySQL DB With PHP


hellonoko

Recommended Posts

Gave that I try. Page seems to work fine. But where is this backup going? Cant find it anywhere. Running on WAMP btw.

 

<?php

 

include 'dbconnect.php';

 

$dbname = "idea";

 

$dbhost = "localhost";

$dbuser = "idea";

$dbpass = "idea";

 

 

$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';

$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";

system($command);

 

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.