php - how can i export db from mysql without exec() function
I am trying to get the database dump from a live mysql server. I don't have db access. from googling I have found a way to get this throughexec()
like this
$command='mysql -h' .$mysqlHostName .' -u' .$mysqlUserName .' -p' .$mysqlPassword .' ' .$mysqlDatabaseName .' < ' .$mysqlImportFilename;
exec($command,$output=array(),$worked);
working nice on local host . But when i tried this on live server then i come to know that exec() is not enable on server . I have checked this with this method
if(function_exists('exec')) {
echo "exec is enabled";
}else
{
echo "exec is not enabled";
}
and also tried this
if(exec('echo EXEC') == 'EXEC'){
echo 'exec works';
}else
{
echo "exec is not enabled";
}
I want to know is there a method so that i can export db dump withoutexec()
function .Because I don't have server access.
Answer
Solution:
If you don't need you own script you should go for phpMyAdmin to create dumps or use a tool like phpMiniAdmin. You can also check their sources to see how simple it is creating dumps just with plain queries and without the need of
exec()