I am working on backup and recovery of mySQL database using mysqldump. My code generates an sql file but its empty. Here's my complete code. Thanks a lot.
<?
shell_exec("mysqldump -u root -p ilamdb > db/ilamdb.sql");
echo "Back up complete.";
?>
2>anotherfile
) so you can capture the error message and look at it afterwards.> db/ilamdb.sql
). I suggest that you also capture the stderr (with2>anotherfile
) so that you will be able to see the error message that themysqldump
command produces.