如何保存mysql查询'SHOW STATUS'到txt文件。我使用-->
MySQL -u root -e "SHOW STATUS;"
我刚刚创建了一个名为c:devin.txt
的命令文件,并将结果转储到c:devout21.txt
来说明这一点。
in.txt
包含1行,末尾有一个换行符:
show status;
运行mysql with in and out
mysql -uUserName -p <c:devin.txt >c:devout21.txt
或
mysql -uUserName -p < /path/to/in.txt >/path/to/out21.txt
检查c:devout21.txt(或/path/to/out21.txt)
Variable_name Value
Aborted_clients 4
Aborted_connects 64
Binlog_cache_disk_use 0
Binlog_cache_use 0
Binlog_stmt_cache_disk_use 0
Binlog_stmt_cache_use 0
...
...
...