I'm almost afraid to ask... I do like the way HeidiSQL can export and format complex queries via the "export grid rows" function to an HTML output.
Now I wonder if this can be automated from the command line. So far I can open a database and preload the query into a query window from command line, but executing and exporting has to be done manually in the GUI.
And yes, I am aware I could and maybe should do this by some own code and formatting via the mysql command line...