liuweiq 2020-06-11
4、html格式输出 --html
[ ~]# mysql -u root -pXXXX -e ‘show databases‘ --html
Warning: Using a password on the command line interface can be insecure.
<TABLE BORDER=1><TR><TH>Database</TH></TR><TR><TD>information_schema</TD></TR><TR><TD>alarms</TD></TR><TR><TD>datariver</TD></TR><TR><TD>datariver_new</TD></TR><TR><TD>dop_monitor</TD></TR><TR><TD>dop_users</TD></TR><TR><TD>falcon_portal</TD></TR><TR><TD>mysql</TD></TR><TR><TD>performance_schema</TD></TR><TR><TD>test</TD></TR></TABLE>[ ~]#
5、xml格式输出 --xml
[ ~]# mysql -u root -pXXXX -e ‘show databases‘ --xml
Warning: Using a password on the command line interface can be insecure.
<?xml version="1.0"?>
<resultset statement="show databases
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<field name="Database">information_schema</field>
</row>
<row>
<field name="Database">alarms</field>
</row>
<row>
<field name="Database">datariver</field>
</row>
<row>
<field name="Database">datariver_new</field>
</row>
<row>
<field name="Database">dop_monitor</field>
</row>
<row>
<field name="Database">dop_users</field>
</row>
<row>
<field name="Database">falcon_portal</field>
</row>
<row>
<field name="Database">mysql</field>
</row>
<row>
<field name="Database">performance_schema</field>
</row>
<row>
<field name="Database">test</field>
</row>
</resultset>