Re: Bash script to MySql

2004-02-05 Thread Michael Stassen
Scott Haneda wrote: on 02/05/2004 07:29 AM, Michael Stassen at [EMAIL PROTECTED] wrote: Also, you need the FILE privilege to SELECT INTO OUTFILE. Alternatively, you could simply redirect output to a file. mysql dbname -e "SELECT serial FROM serials" >/path/to/outfile In this case, the file i

Re: Bash script to MySql

2004-02-05 Thread Scott Haneda
on 02/05/2004 07:29 AM, Michael Stassen at [EMAIL PROTECTED] wrote: > Also, you need the FILE privilege to SELECT INTO OUTFILE. > > Alternatively, you could simply redirect output to a file. > > mysql dbname -e "SELECT serial FROM serials" >/path/to/outfile > > In this case, the file is written

Re: Bash script to MySql

2004-02-05 Thread Michael Stassen
Scott Haneda wrote: 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-colu

Re: Bash script to MySql

2004-02-04 Thread Bernd Tannenbaum
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 >

Re: Bash script to MySql

2004-02-04 Thread 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-nam

OT: Bash script to MySql

2004-02-04 Thread Dan Muey
Sorry for the OT, I deleted the messages from the perosn who sent me a response offlist. In response to his personal emails in reply to: http://lists.mysql.com/mysql/158945 he said, Perl was a write only language (meaning it is hard to read since careless people may do sloppy code - not me tho

RE: Bash script to MySql

2004-02-04 Thread Dan Muey
> Why not use another language that has mysql hooks built in? Good suggestion. > For example, from version 4.3.0 PHP comes with SAPI to allow > scripting from the command line, ideal for cron style tasks > and it's mysql support is very mature. Or better yet, Perl. Not only is its mysql suppor

RE: Bash script to MySql

2004-02-04 Thread Russell Horn
Why not use another language that has mysql hooks built in? For example, from version 4.3.0 PHP comes with SAPI to allow scripting from the command line, ideal for cron style tasks and it's mysql support is very mature. -- Russell. -- MySQL General Mailing List For list archives: http://lists

Re: Bash script to MySql

2004-02-04 Thread Bernd Tannenbaum
Hi, Am Mittwoch, 4. Februar 2004 07:19 schrieb Hassan Schroeder: Scott Haneda wrote: > I need to to the following > Select serial from serials; > > Problem is I need to run this from a script which cron will call once a > day, how do you pass a select statement to mysql with user and pass so it >

Re: Bash script to MySql

2004-02-04 Thread Duncan Hill
On Wednesday 04 February 2004 05:44, Scott Haneda wrote: > I need to to the following > Select serial from serials; > > Problem is I need to run this from a script which cron will call once a > day, how do you pass a select statement to mysql with user and pass so it > can all happen in one go? my

Re: Bash script to MySql

2004-02-04 Thread Hassan Schroeder
Scott Haneda wrote: I need to to the following Select serial from serials; Problem is I need to run this from a script which cron will call once a day, how do you pass a select statement to mysql with user and pass so it can all happen in one go? Something like this should work: #!/bin/bash /path

Bash script to MySql

2004-02-04 Thread Scott Haneda
I need to to the following Select serial from serials; Problem is I need to run this from a script which cron will call once a day, how do you pass a select statement to mysql with user and pass so it can all happen in one go? -- - Scott