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.
Comments
Post a Comment