Re: system(): access denied
| From: | Chris Boget | Date: | Thu, 16 Jan 2003 15:33:46 +0000 |
| Subject: | Re: system(): access denied | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131874@lists.php.net to get a copy of this message | ||
> But why it is ok when i use system("mysqldump -uroot -p >my_dump_file.sql")?
As alluded to by the last user (who got the command wrong), when you
do:
system("mysql -uroot -p < the_dump_file.sql")
it doesn't know where the command ends and the input begins. So what's
going on is that the command thinks that the password is coming from the
"the_dump_file.sql". So while you think that is the data you are passing to
the "mysql" executable, the system call thinks it's what you are passing
to the "-p" option.
Try doing this instead and see if it doesn't work:
system( "cat the_dump_file.sql | mysql -uroot -p" );
Chris