Click to See Complete Forum and Search --> : [RESOLVED] mysqldump returns nothing


Stevish
01-14-2010, 02:57 PM
...and I mean NOTHING!

I don't have shell access, so I can't test that way, but here's what I'm trying to do:


<?php
$command = "mysqldump -u$db_user -p$db_pass $db_name";
ob_start();
system($command);
$data = ob_get_clean();
?>


$data ends up completely empty.

When I try system("mysqldump --help") it displays the help file perfectly

I echoed out $command, and everything looks perfect there

I tested the username, password, and db_name in a different type of command and they are all fine

I have tried adding " > filename" to the end and the file is never written even though the directory is modded to 777

I think I have tried everything and searched everywhere but to no avail. Nothing seems to help. Does anyone know why this command would return nothing? The databases are far from empty, and even if they were, there should be some sort of data there.

I am at my wits end and definitely need some help. I'm willing to try anything, so hit me with your best shot.

Stevish
01-14-2010, 03:07 PM
New info: I added a return variable, and came up with a code of 2 (access denied I think). Should I be using quotations around the username or password?

Here's one of the passwords (I'll change it later): eNF{)$4rJ~m]
Are there illegal characters in there or something?

Stevish
01-14-2010, 03:10 PM
Well, nevermind, it's fixed.

For those wondering, adding single quotes around the username and password did the trick:

$command = "mysqldump -u'$db_user' -p'$db_pass' $db_name";