I’m trying to generate a mysql dump file from PHP using the following:
exec('mysqldump -u root -ppassword maindb > c:\DB_Dump.sql');
However the file being generated is blank. Anyone knows what’s wrong?
From the cmd, this is working:
cd C:\Program Files\MySQL\MySQL Server 5.5\bin to change the path and then
mysqldump -u root -ppassword maindb > c:\DB_Dump.sql
But I’m trying to do it within PHP.
To discard most common issues:
The path to mysqldump in your computer appears to have white spaces. Make sure you quote it properly: