Re: bash powered MySQL Queries

2005-01-31 Thread beacker
I just wanted to know what would be the easiest way to retrieve simple data from a MySQL database from a bash script. Easiest way I've used to do it is: mysql EOQ select count(1) from tables; EOQ Which allows you to feed random queries to mysql from a bash script. Brad

Re: bash powered MySQL Queries

2005-01-31 Thread andy thomas
On Sun, 30 Jan 2005, Andy wrote: Hi all I just wanted to know what would be the easiest way to retrieve simple data from a MySQL database from a bash script. I do this a lot - just construct the query and dump it into a file from within the script, eg: echo select * from widgets

Re: bash powered MySQL Queries

2005-01-31 Thread Andy
Thank you all for your replies. I think that ShellSQL is really the thing I am looking for. With kind regards Andy On Sun January 30 2005 23:50, Andy wrote: Hi all I just wanted to know what would be the easiest way to retrieve simple data from a MySQL database from a bash script.

Re: bash powered MySQL Queries

2005-01-31 Thread Jason Martin
On Mon, Jan 31, 2005 at 06:57:58PM +, Edward Macnaghten wrote: 1 - The output is not cluttered with headers, and a means exist to easily separate fields when there is more than one column or row in the query. The mysql --batch option should take care of that for you. -Jason Martin -- If

Re: bash powered MySQL Queries

2005-01-31 Thread Edward Macnaghten
Forgive me for blowing my own trumpet here. The advantage with ShellSQL over this method is 1 - The output is not cluttered with headers, and a means exist to easily separate fields when there is more than one column or row in the query. 2 - The connection is persistant, whereas running

Re: bash powered MySQL Queries

2005-01-30 Thread Edward Macnaghten
Funny you should mention that May I guide you to my recent announcment of ShellSQL 0.7 - web page at http://www.edlsystems.com/shellsql - a utility to do just as you want (I think) released under GPL. It must be good - I wrote it myself :-) Yours Eddy Andy wrote: Hi all I just wanted to

Re: bash powered MySQL Queries

2005-01-30 Thread Kevin A. Burton
Edward Macnaghten wrote: Funny you should mention that May I guide you to my recent announcment of ShellSQL 0.7 - web page at http://www.edlsystems.com/shellsql - a utility to do just as you want (I think) released under GPL. It must be good - I wrote it myself :-) SELECT * FROM /dev/zero