Bhushan Bhushan - 1 month ago 7
MySQL Question

How to access mysql database using shell script?

Is there a way I can access MySQL database using shell script?
want to do some selects and some inserts on multiple tables?

It will be great if you can give some sample code as I am new to scripting.

Answer

This link seems to have the information you want.

http://www.cyberciti.biz/faq/using-mysql-in-shell-scripts/

mysql -u user -p dbnane