Mysql Query in a Shell file?

08/15/2014 16:14 sema1995#1
Hello, i'm tryiing to use a query in a shell file but i not know the sintax, anyone can help me?

Here a example:
PHP Code:
#!/bin/sh
os.execute("mysql Update auktionhaus.auktionhaus_items SET tiempo = tiempo -3600 where tiempo > 3600")
But not work xd 
Thanks.
08/15/2014 17:45 Damn'#2
PHP Code:
!/bin/bash
mysql 
-u root -pPASSWORD<<EOF
Update auktionhaus
.auktionhaus_items SET tiempo tiempo -3600 where tiempo 3600;
EOF 
08/15/2014 18:11 sema1995#3
Quote:
Originally Posted by Damn' View Post
PHP Code:
!/bin/bash
mysql 
-u root -pPASSWORD<<EOF
Update auktionhaus
.auktionhaus_items SET tiempo tiempo -3600 where tiempo 3600;
EOF 
Thanks for reply but..
Bash not found and i put now, !/bin/sh and...
[Only registered and activated users can see links. Click Here To Register...]
08/15/2014 18:13 Damn'#4
you should enter -pPASSWORD to you password ^^
08/15/2014 18:23 sema1995#5
Quote:
Originally Posted by Damn' View Post
you should enter -pPASSWORD to you password ^^
Yes, now i understand works fine, thanks
08/16/2014 08:11 #dynastie#6
Use -e/--e Parameter. Better than EOF-methode.