• 欢迎访问VPS岛网站,国外VPS,国内VPS,国外服务器,国内服务器,服务器主机,测评及优惠码,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站 QQ群

mysql的output输出格式

mysql技术 gaodi2002 51次浏览 已收录 0个评论

默认是-t输出
1、表格输出 -t
[root@UAA1 ~]# mysql -u root -pXXXX -e ‘show databases’ -t
Warning: Using a password on the command line interface can be insecure.
+——————–+
| Database |
+——————–+
| information_schema |
| alarms |
| falcon_portal |
| mysql |
| performance_schema |
| test |
+——————–+
2、批处理输出–batch 或-B
[root@UAA1 ~]# mysql -u root -pXXXX -e ‘show databases’ -B
Warning: Using a password on the command line interface can be insecure.
Database
information_schema
alarms
falcon_portal
mysql
performance_schema
test
3、垂直输出 –vertical
[root@UAA1 ~]# mysql -u root -pDtDream0209 -e ‘show databases’ –vertical
Warning: Using a password on the command line interface can be insecure.
1. row
Database: information_schema
2. row
Database: alarms
3. row
Database: datariver
4. row
Database: datariver_new
5. row
Database: dop_monitor
6. row
Database: dop_users
7. row
Database: falcon_portal
8. row
Database: mysql
9. row
Database: performance_schema
10. row
Database: test

4、html格式输出 –html
[root@UAA1 ~]# 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>[root@UAA1 ~]#

5、xml格式输出 –xml
[root@UAA1 ~]# 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”&gt;
<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>


VPS岛 的文章和资源来自互联网,仅作为参考资料,如果有侵犯版权的资源请尽快联系站长,我们会在24h内删除有争议的资源。丨 转载请注明mysql的output输出格式
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址