php exec() - mysqldump creates an empty file

后端 未结 7 1638
再見小時候
再見小時候 2021-01-11 14:22

I want to create a backup from a database, but I get only a blank file.

include(\'config.php\');

$command = \"mysqldump --opt -h \".$_host.\" -u \".$_user.\         


        
7条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-11 15:06

    You should remove the space between the -p and the password.

    --opt isn't needed with recent versions of mysql.

    Other than that, your syntax is correct so if it doesn't work with the -p fix, you should check the parameters and the produced command.

提交回复
热议问题