Use the --tee MySQL command. Login to MySQL with this command: mysql --user=root --password=root --tee= c:\mysqloutput.txt -h hostname By using the --tee option when invoking MySQL from a command prompt, statements and output can be logged. All the data displayed on the screen is appended to file referenced in the command, in this example - c:\mysqloutput.txt More advanced usage, mysql -u root -p --tee=batch5output.txt --line-numbers -vvv --skip-column-names comments: -vvv (output the sql scripts as well) Also, execute notee at any time you don't want output the following contents and execute tee when you want output log again. Cheers.
The reason for doing the work is to create something useful that helps people. Please click the ads if my articles are useful for you. Definitely, that's not enough. My target is working at some great organizations, such that one day, all the people with internet access can benefit from the service I contributed.