Pages

Tuesday, June 26, 2012

Running mysql query from shell script

This is the simple method to run a mysql query from Bash script

Query3="select * from ta_lookup where gds = 'wsp' and server like  'reported%';"
echo   "$Query3" | mysql --host=tiber12 mvc 

 ###### mvc is name of database and --host is the database host

No comments:

Post a Comment