简体   繁体   中英

mysqldump sql file save without content

i have this php script.when i run the script mysqldump, The file got saved but the content is empty. Any help is appreciated.

thank you.

$filename = "backup-" .  date("YmdHis") .  ".sql";
$pathfile = public_path('database') .'/' .$filename;

exec('mysqldump -u'.env('DB_USERNAME').' -p'.env('DB_PASSWORD').' '.env('DB_DATABASE'). ' > ' . $pathfile);

echo 'done';

No Error is printing, But the file is empty

您需要确保mysqldump处理器位于PATH上的文件夹中,或者必须将mysqldump处理器的完整路径添加到对该处理器的PHP调用中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM