write to file sql commandline code example Example: mysql cli output to a file mysql> tee /tmp/my.out;