Re: system(): access denied

From: Date: Thu, 16 Jan 2003 15:38:22 +0000
Subject: Re: system(): access denied
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-131879@lists.php.net to get a copy of this message
This is infact not the case, using the < operator does not make the mysqldump program read that file and interpret the data in the file as the password, if you have a proper password set and use the -p option (even with a < operator) it will still ask you for a password. On Thu, 2003-01-16 at 10:33, Chris Boget wrote: > 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt (adam@cryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
« previous php.general (#131879) next »