Hi, Am Donnerstag, 5. Februar 2004 03:43 schrieb Scott Haneda: > on 02/04/2004 02:23 AM, Bernd Tannenbaum at [EMAIL PROTECTED] > > wrote: > > 2 possible ways to go: > > > > Feed a Textfile with your statement in the db: > > PATH/mysql db < /sql_scripts/sql_statements_as_textfile --password=pass > > > > Give command directly In the shell-script: > > PATH/mysql --skip-column-names -e "SELECT table SET blabla" db > > --password=pass > > I need to select into outfile on this one, which poses a problem to me, I > can not write the file to any directory as I get a permissions error since > mysql is the owner of this file, how would I do this ?
Dunno if i get you right. You want to write the stuff found by your SELECT into a file on your local machine but the user mysql does not have permission to write anywhere in your system? If thats the problem then you have few options i think. "sudo" would be a way to go. You could give root-rights to a single command of ur choice that way. Another thing is that you can store the value from the SELECT in a bash-variable if ya like. Like this: var=`PATH/mysql --skip-column-names -e "SELECT MAX(id) FROM table" db --password=pass`; This way you can keep the value in the shell and write it wherever you have the right to write to. Well, if mysql has no rights at all that won`t help u much i think. So if ya cannot change any rights "sudo" is the only option i know of but maybe its worth to ask some linux-freaks about it... Good luck, Bernd -- [Zufallssig 1] Windows found - Remove? [Y]es [S]ure [F]ine [O]K -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]