Using PHP script: why mysqldump does not dump sql file?

£可爱£侵袭症+ 提交于 2019-11-28 14:24:56

Okay, actually I already solve this issues a few days later after I post the question. Unfortunately, I didn't have enough reputation to post an answer.So here we go.

Here are a few things that need to TAKE NOTE:-

  1. Compulsory to use absolute path for MySQL dump.
  2. Try using --opt (default option for MySQL dump). Read more here.
  3. For the option, if use short form, no need to have (--). eg: --p. Use (--) when use full form. eg: --password. So use '-p' instead of '--p' (applied for others option too).
  4. try 'shell_exec' or 'system' if mysqldump doesnt work on 'exec'.
  5. try avoid have space between option and variable. Eg: -p$dbpass

*Also bear with mind, it involves with permission whether system command can be executed from php or not.

I assume your php permits execution of commands through system().

you are not running in safe mode, or, if you are, safe_mode_exec_dir contains all the commands you need

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!