0

I had used php exec shell commands to get the dump of database. Its working fine on local but when i run that same php file on server, it says 'mysqldump' is not recognized as an internal or external command, operable program or batch file.

I am using the database credentials of the live database on godaddy server with windows hosting(PLESK)

shell_exec('mysqldump --host='.$mysqlHostWithNoPort.' --password='.$mysqlPassword.' '.$DbName.' --user='.$mysqlUserName.' --single-transaction>DB_Backup/'.$filename .' 2>&1');

I had defined the variables used above in my config file.

Amanjot Kaur
  • 2,028
  • 4
  • 18
  • 33
  • Have you asked the host if the have it –  Aug 08 '16 at 09:56
  • I run that mysql dump command on local cmd, it works..@Dagon – Amanjot Kaur Aug 08 '16 at 09:58
  • @KuHyeSun as you said `local`. It is a big difference between `local` and `host`. You may not even have permission to use `shell_exec` command. If you want to use the shell commands, you may want to look into dedicated host. – Vasil Rashkov Aug 08 '16 at 10:12
  • file is creating, it means shell is working but mysqldump not working.. What do i need to ask from the host? I googled and find that before writing mysqldump, i have to give the path where mysqldump is present. Can we get that where mysqldump is present? @Dagon – Amanjot Kaur Aug 08 '16 at 10:17
  • Ask godaddy to walk you thru it. That is what you pay them for. – Drew Aug 08 '16 at 14:03

0 Answers0