Jump to content


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


why my sqldump returns a blank file... sigh~~

Recommended Posts

I am all confused here. My code write as such;

#!/usr/local/bin/php -q


$DB_HOST = "localhost";
$DB_NAME = "someDb"; 

$LOCAL_DUMP_PATH = "C:/apache/htdocs/";   
$FILENAME_PREFFIX = "sqldump";           

$filename = $FILENAME_PREFFIX.date("YmdHis").".sql";

$dump_cmd = "mysqldump -h$DB_HOST -u$DB_USERNAME -p$DB_PASSWORD";

if ($DB_NAME == "all" || $DB_NAME = "ALL") {
  $dump_cmd .= " --all-databases";
} else {
  $dump_cmd = " $DB_NAME";

$dump_cmd .= " > $LOCAL_DUMP_PATH$filename"; 

echo "Data has been backed up!!!";


This code certainly creates the file, but the files were blank! Please anyone xplain this to me...thanks..

btw, I'm using phpmyadmin 2.5.0..

Share this post

Link to post
Share on other sites


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.