I run bat-file in Windows to clean MySQL Data Base at night. bat-file just use sql-script with simple delete-where operators.
code in bat-file like : "date /T >> cleaner_front.log" log some useful info to output file
code in script.sql file like : SELECT '14. delete from table (7 days)' AS '_'; SELECT NOW(); log some useful info too.
But if script.sql contains some errors (like table doesn't exists), error-message (ERROR 1146 (42S02) at line 56: Table '...' doesn't exist) was not written to output file
How can I write error messages from MySQL to common cleaner_front.log file during execution?