List:General Discussion« Previous MessageNext Message »
From:sheeri kritzer Date:October 24 2005 5:18pm
Subject:Re: multiple commands to mysql from regular command line
View as plain text  
> If you just need to select a database, you can do it while connecting to mysql:
>
> mysql -u${DB_USER} -p${DB_PASSWORD} ${DATABASE} -e 'update foo set bar=0'
>
> Although the other suggestions, of using semicolons or scripts, work
> as well.  If it's just a one-liner, though, the above will work.
>
> -Sheeri
>
> On 10/21/05, Dustin Krysak <mailinglists@stripped> wrote:
> > Hi there, I was wondering if it was possible to issue multiple
> > commands to mysql from a regular command line? For example i know you
> > can issue a single by the following:
> >
> >
> > mysql -u${DB_USER} -p${DB_PASSWORD} -e 'show databases'
> >
> > Now what if for example i needed to select a database, then run an
> > update against it? With a single command it exits back out to a
> > shell, so there is no chance to issue a 2nd command.
> >
> > Thanks in advance!
> >
> > Dustin
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
> >
> >
>
Thread
multiple commands to mysql from regular command lineDustin Krysak21 Oct
  • Re: multiple commands to mysql from regular command lineJasper Bryant-Greene21 Oct
  • Re: multiple commands to mysql from regular command lineHassan Schroeder21 Oct
  • Re: multiple commands to mysql from regular command linesheeri kritzer24 Oct