timsweb Posted December 2, 2008 Share Posted December 2, 2008 Hey, having some problems with system fuction and mysqldump working - $date = time(); $path = getcwd(); $path = str_replace("\\", "/", $path); $backupfile = $path.'/backups/'.$date.'.sql.gz'; $command = "mysqldump -u $dbuser -p $dbpasswd -h $dbpasswd --routines --master-data --single-transaction --skip-add-locks --skip-lock-tables --default-character-set=utf8 --compress $dbname > $backupfile"; system($command); For some reason this wont produce anything and i cant see why? any ideas why? Thanks, Tim Link to comment https://www.neowin.net/forum/topic/705208-phpmysql-mysqldump-and-system-function/ Share on other sites More sharing options...
0 tmahmood Posted December 2, 2008 Share Posted December 2, 2008 you are providing wrong argument for host unless your password and host are same the -h param is wrong I believe. Link to comment https://www.neowin.net/forum/topic/705208-phpmysql-mysqldump-and-system-function/#findComment-590213790 Share on other sites More sharing options...
0 timsweb Posted December 2, 2008 Author Share Posted December 2, 2008 ah! Thank you :) Fixed that but still wont work!, dosent produce anything still, any ideas? Thanks, Tim Link to comment https://www.neowin.net/forum/topic/705208-phpmysql-mysqldump-and-system-function/#findComment-590213998 Share on other sites More sharing options...
0 tmahmood Posted December 2, 2008 Share Posted December 2, 2008 why not run the command in the terminal first to check if its working correctly? Link to comment https://www.neowin.net/forum/topic/705208-phpmysql-mysqldump-and-system-function/#findComment-590214576 Share on other sites More sharing options...
0 slkandy Posted December 2, 2008 Share Posted December 2, 2008 There's no space between the -p parameter and the password. Link to comment https://www.neowin.net/forum/topic/705208-phpmysql-mysqldump-and-system-function/#findComment-590215924 Share on other sites More sharing options...
0 _bobcat_ Veteran Posted December 2, 2008 Veteran Share Posted December 2, 2008 Moved here. Link to comment https://www.neowin.net/forum/topic/705208-phpmysql-mysqldump-and-system-function/#findComment-590216228 Share on other sites More sharing options...
Question
timsweb
Hey, having some problems with system fuction and mysqldump working -
$date = time(); $path = getcwd(); $path = str_replace("\\", "/", $path); $backupfile = $path.'/backups/'.$date.'.sql.gz'; $command = "mysqldump -u $dbuser -p $dbpasswd -h $dbpasswd --routines --master-data --single-transaction --skip-add-locks --skip-lock-tables --default-character-set=utf8 --compress $dbname > $backupfile"; system($command);For some reason this wont produce anything and i cant see why? any ideas why?
Thanks, Tim
Link to comment
https://www.neowin.net/forum/topic/705208-phpmysql-mysqldump-and-system-function/Share on other sites
5 answers to this question
Recommended Posts