get mysql terminal output in a text file code example Example: mysql cli output to a file mysql> tee /tmp/my.out;