MySQL Forums
Forum List  »  PHP

Re: Restoring a Backup from mysqldump
Posted by: Rick James
Date: October 11, 2014 09:59PM

-p"%s"
-p%s

Neither of those is perfect. The second on (which you are using for restoring) will not work if there is a space in the password.
The first one (and maybe the second one) will not work if there is a double-quote in the password.

Consider using
sprintf(" ... -p%s ...", ..., escapeshellarg($dbpass), ...)
And you may as well do likewise for the other parameters, just in case.

Clearly the only one that stands a changes is the one with the gunzip.

What Operating system are you using?

echo the result of the sprintf, something may jump out as being wrong.

Options: ReplyQuote


Subject
Written By
Posted
Re: Restoring a Backup from mysqldump
October 11, 2014 09:59PM


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.