Here's a handy batch file for MySQL Databases (selects, updates, etc):
rem - Note SQL Statements that generate files should have their outfile deleted first!
set sqlcommand="Your SQL Statement Here"
rem - Nav to your MySQL / MariaDB Instance, edit path to your preference:
cd d:\
cd "d:\mariadb 5.5\bin\"
rem - Pipe your SQL command into a txt file:
echo %sqlcommand% > sql.txt
rem Execute your SQL, provide username and password as arguments to the batch file:
mysql --user=%1 --password=%2 --database="database name" < sql.txt
Might be messy, but sure as heck effective!
Added Bonusl when setting up the task, specify the text file (if one is created by your statement) as the log file in LMI, and now you can view the resulting file in LMI. (Feature Suggestion: email the log file along with the task summary emails!)
Also in hindsight, the database name could be another batch file argument!