With phpmyadmin you can make a backup of jr database. But I would like to do that from phprunner. I have made a link from phprunner to a php file that does the backup :
<?php
ob_start();
$username = "XXXX";
$password = "XXXXXX";
$hostname = "localhost";
$dbname = "MY_DATABASE";
// if mysqldump is on the system path you do not need to specify the full path
// simply use "mysqldump --add-drop-table ..." in this case
$command = "mysqldump --add-drop-table --host=$hostname --user=$username ";
if ($password)
$command.= "--password=". $password ." ";
$command.= $dbname;
system($command);
$dump = ob_get_contents();
ob_end_clean();
// send dump file to the output
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($dbname . "_" . date("Y-m-d_H-i-s").".sql"));
flush();
echo $dump;
exit();
?>
This script works great locally, but unfortunately not on the hosting server. Is there another possibility to generate a backup of the (MySql) database with a phprunner application?