MySQL in batch mode
I need to run MySQL in batch mode such that commands are given automatically from a text file. I've discovered that i need to do it as:
mysql < sqlfile.sql
,where sqlfile.sql contains all the sql commands which i want to give to MySQL.
However I am prompted with a password each time, and this is not what i really want since i want to call this script file on the background each time some event is triggered. I tried using a 'here document' technique but was in vain. Are there any method to do it? I'm using bash, but can move to C if it is required. Thanks for your help.