默认是-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.

Database
information_schema
alarms
datariver
datariver_new
dop_monitor
dop_users
falcon_portal
mysql
performance_schema
test
[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.

;

information_schema


alarms


datariver


datariver_new


dop_monitor


dop_users


falcon_portal


mysql


performance_schema


test