可以直接将结果输出到文件:

mysql -u用户名 -p'密码' -D'数据库' -h'IP地址' -e"要执行的SQL" > /tmp/file.txt
posted on 2022-05-26 14:15  jiayou111  阅读(78)  评论(0)    收藏  举报