Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

Help with mysqldump

Codes here !

Moderators: macek, egami, gesf

Help with mysqldump

Postby kelvin24 » Sun Sep 23, 2012 7:32 am

Code: Select all
<?php


$dbhost   = "localhost";
$dbuser   = "root";
$dbpwd    = "kelvin";
$dbname   = "softeng";
date_default_timezone_set('Asia/Brunei');
$dumpfile = $dbname . "_" . date("Y-m-d_H-i-s") . ".sql";

passthru("/usr/bin/mysqldump --opt --host=$dbhost --user=$dbuser --password=$dbpwd $dbname > $dumpfile");

// report - disable with // if not needed
// must look like "-- Dump completed on ..."

echo "$dumpfile "; passthru("tail -1 $dumpfile");

?>


I've got this code from this tutorial http://www.tutorialspoint.com/php/perfo ... up_php.htm
and by some reason its not working on me. Its not creating a backup...someone pls help!
kelvin24
New php-forum User
New php-forum User
 
Posts: 12
Joined: Mon Aug 13, 2012 5:11 pm

Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron