I want to take backup of mysql database from php file
Normal shell command is
mysqldump --opt database > backup-file.sql
and for taking a backup with password is
mysqldump -p database > backup-file.sql
So when i give the above shell command it asks for a password when i gives the password it do the rest of things.
Now i have to do it from PHP
so i have shell_exec("mysqldump -p database > backup-file.sql")
but then how should i give the password is there any way in PHP to do this.