I tried the below code to backup my database "db_school".
<?php
shell_exec('mysqldump -u root -h localhost db_school > backup-file.sql');
?>
The new file named "backup-file.sql" is created but, the problem is that it is totally empty. Following is my database table:
-------------------------------------
id | school_name | city
-------------------------------------
1 | cp school | New York
2 | public school | San Fracisco
-------------------------------------
Note: my 'root' user has no password I know there are many posts on this topic but each suggests the code similar to above