I want to run a SSH command using a cron and I want to extent this cron by adding autocommit=0
So that auto commit is disabled.
How can I achieve this?
Command:
mysql dbname -u dbuser -p'password' < /path/to/the/sqlscript/var/sql/stock.sql
There are many ways to prepend / append a string to a file. A simple way:
(echo "set autocommit=0;"; cat stock.sql; echo "set autocommit=1") | mysql dbname -udbuser -ppassword