php - how can i export db from mysql without exec() function

487

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.

636

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 ofexec()

People are also looking for solutions to the problem: javascript - JSON data being received in an incomplete format in php?

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.