I am writing an .sh file from where I am trying to access one .sql file where I have the query that needs to be run on scheduled basis.
Below is the line by which I try to make connection to the Database:
/home/mysql/mysql/bin/mysql --port=$PORT --host=$HOST --user=$DB_USER --password=$DB_PASSWORD --database=$DB_NAME < ${SQL_SCRIPT_PATH}${SQL_SCRIPT_NAME} >> ${LOG_FILE_PATH}${LOG_FILE_NAME}
But, the problem is when the scheduler is executed, it gives the below error:
[example@mchpXXX TEST_sh]$ sh updateMonthlyUserData.sh
updateMonthlyUserData.sh: line 15: mysql: command not found
Note: I tried to run this and got success if I run the sh file manually from putty and not through scheduler(crontab)
Kindly check and help.