--output (-o)
This page is part of MariaDB's Documentation.
The parent of this page is: mariadb-shell for MariaDB Shell
Topics on this page:
Overview
Output stylings
See also: mariadb-shell for MariaDB Shell, in 23.02, in 23.01, in 22.12, and in 22.10
USAGE
mariadb-shell [{--output | -o} {json | json pretty | xml | mysql | classic | csv | tsv | sqlplus | html | modern | none}]
DETAILS
Option | Default Behavior | Argument |
---|---|---|
--output -o | If omitted, MariaDB Shell uses the | One of the predefined output styles: |
EXAMPLES
To enable a JSON style output:
$ mariadb-shell \
--host host.example.com \
--user user_name \
--password 'user_password' \
--execute "SHOW GLOBAL VARIABLES LIKE 'gtid_bin_%';" \
--output json
{"columns": ["Variable_name", "Value"], "rows": {"0": {"Variable_name": "gtid_binlog_pos", "Value": "0-100-102"}, "1": {"Variable_name": "gtid_binlog_state", "Value": "0-100-102"}}, "unnumbered": [["gtid_binlog_pos", "0-100-102"], ["gtid_binlog_state", "0-100-102"]]}
To enable an XML style output using the short option names:
$ mariadb-shell \
-h host.example.com \
-u user_name \
-p 'user_password' \
-e "SHOW DATABASES;" \
-o xml
<result><0><Database>information_schema</Database></0><1><Database>mysql</Database></1><2><Database>performance_schema</Database></2><3><Database>sys</Database></3><4><Database>test</Database></4></result>
CHANGE HISTORY
Release Series | History |
---|---|
23.03 |
|
23.02 |
|
23.01 |
|
22.12 |
|
22.10 |
|