List:General Discussion« Previous MessageNext Message »
From:Bernd Tannenbaum Date:February 4 2004 10:23am
Subject:Re: Bash script to MySql
View as plain text  
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
> can all happen in one go?

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

Have fun
Bernd

-- 
[Zufallssig 10]
[Deng] on AO Forum: "Good judgement is the result of experience...
 experience often comes from bad judgement."

Thread
column being created as varchar() when char() requested.Philip Walden3 Feb
  • Re: column being created as varchar() when char() requested.Michael Stassen3 Feb
    • Re: column being created as varchar() when char() requested.Philip Walden3 Feb
      • Re: column being created as varchar() when char() requested.Michael Stassen3 Feb
        • Re: column being created as varchar() when char() requested.Philip Walden4 Feb
          • Monthly reportingScott Haneda4 Feb
            • Bash script to MySqlScott Haneda4 Feb
              • Re: Bash script to MySqlHassan Schroeder4 Feb
                • Re: Bash script to MySqlBernd Tannenbaum4 Feb
                  • RE: Bash script to MySqlRussell Horn4 Feb
                  • Re: Bash script to MySqlScott Haneda5 Feb
                    • Re: Bash script to MySqlBernd Tannenbaum5 Feb
                    • Re: Bash script to MySqlMichael Stassen5 Feb
                      • Re: Bash script to MySqlScott Haneda6 Feb
                        • Re: Bash script to MySqlMichael Stassen6 Feb
              • Re: Bash script to MySqlDuncan Hill4 Feb
              • User Defined FunctionBácskai Gergő" 4 Feb
          • Re: column being created as varchar() when char() requested.Michael Stassen4 Feb
            • Re: column being created as varchar() when char() requested.Philip Walden5 Feb
              • Re: column being created as varchar() when char() requested.Michael Stassen5 Feb
                • Re: column being created as varchar() when char() requested.Philip Walden6 Feb
                  • Re: column being created as varchar() when char() requested.Michael Stassen6 Feb
  • Re: column being created as varchar() when char() requested.Martijn Tonies4 Feb
RE: Bash script to MySqlDan Muey4 Feb