MySQL Forums
Forum List  »  PHP

Re: Restoring a Backup from mysqldump
Posted by: Henning Bergmann
Date: October 10, 2014 05:48AM

Sorry, this is the corrected code, which doesn't work. I just failed to copy it correctly into the message:

neither

system(sprintf('mysql -u%s -p%s -h%s %s < %s',
$dbuser,
$dbpass,
$dbhost,
$dbname,
"path_and_filename.sql"
));

nor

system(sprintf('mysqlimport -u%s -p%s -h%s %s %s',
$dbuser,
$dbpass,
$dbhost,
$dbname,
"path_and_filename.sql"
));

seem to do the trick for me. Both result in '1' as return_value for the system-command.

Options: ReplyQuote


Subject
Written By
Posted
Re: Restoring a Backup from mysqldump
October 10, 2014 05:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.