--- Feny Suha <[EMAIL PROTECTED]> wrote:
> Hi all!
> I've got trouble when i need to run mysql with batch mode. I can't run it.
> I did these following steps
> 
> shell> mysql -u root -p --batch
> password : ******
> -
> 
> then the screen had no effect.
> I do this step too
> 
> shell> mysql -u root -p -B
> password : ******
> -
> 
> this had no effect too.
> 

"the screen had no effect" means nothing to me.

i usually use something like

#!/bin/bash
        IDENTITY="`echo "select text from config where item=\\\"machine_key\\\" ; " |
                mysql --quick -su user -pusersPassword database |
                tail -1 `"

or

#!/bin/bash
while true
do 
   echo ' select count(*) from speed ; ' | 
      mysql -B -A -u user -pusersPassword database |
      tail -1 
   date
   sleep 300
done

when running mysql from a shell script.  note the password
on the command line so it doesn't have to be typed or sent.

my guess is that when it's "no effect" you should type a
valid SQL statement, ending with a semicolon, possibly 
carriage return and possibly EOF (^D) and only then expect 
a response.  in batch mode prompts for a human will not be 
sent to stdout.

duncan.

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to