dump data from database
Posted by: joelim (---.153.95.219.klj01-home.tm.net.my)
Date: May 04, 2007 07:47AM

hi...

joe here... i m using wamp version 1.4.4.

can some body help me on how to dump database instead of using phpmyadmin.

i do write a simple code..but it do not give any response to me...

my code:
<?php
$dbhost= 'localhost';
$dbuser= 'root';
$dbpass= '';
$dbname= 'amanagement';

$backupFile = $dbname . date("Y-m-d-H-i-s"winking smiley . '.gz';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
system($command);

?>

pls help.....but it work fine if i m using phpmyadmin or even i write the dump code in batch file...

my batchfile code:
C:\wamp\mysql\bin
mysqldump amanagement > amanagement.sql

but this file save only in the bin directory.

regards
joelim

Options: ReplyQuote


Sorry, only registered users may post in this forum.