1.通过tee命令结合--html输出查询结果到html文件
[mysql@testvm ~]$ mysql --html #--html选项的意思产生html格式的输出.
Welcome to the MySQL monitor. Commands end with ;
or \g.Your MySQL connection id is 13Server version: 5.7.21-log MySQL Community Server (GPL)Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates.
Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> tee test.html #tee命令表示将之后的内容记录到某个文件
Logging to file 'test.html'
mysql> select * from test.tab_json; #由于使用--html选项,输出的查询结果都是html格式