How to generate error log file while executing a .sql file in terminal
So after a little more searching I found the answer :)

Here is how this needs to be done.


mysql -uroot -xxx! -f main &lt; sq2.sql &gt; /var/www/log.txt &amp;