You can use php script to take backup of the database with the help of mysqldump.
<?php
public static function BackupDatabase($backupPath){
$fileName = uniqid() .'.sql';
$backupCommand = 'mysqldump -u ' . DBUsername . ' abc > ' . $backupPath . $fileName .' 2>&1' ;
echo $backupCommand;
$retVal = '';
$feedback = system($backupCommand, $retVal);
echo $retVal;
if($feedback == NULL || $feedback == '')
return 'Database backed up successfully by name ' . $fileName;
else
return $feedback;
}
?>
1 year 19 weeks ago