php exec() - mysqldump creates an empty file

后端 未结 7 1637
再見小時候
再見小時候 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 14:58

    For those on Macs

    I was battling this issue the entire evening today. Silly mistake: one needs to chmod the directory that you are dumping the file to.

    I ran this which fixed the issue:

    chmod -R 777 your_dump_directory/
    

提交回复
热议问题