--output (-o)

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 modern output style

One of the predefined output styles: json, json pretty, xml, mysql, classic, csv, tsv, sqlplus, html, modern, none

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

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>

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.03

  • Present starting in MariaDB Shell 23.03.1.

23.02

  • Present starting in MariaDB Shell 23.02.1.

23.01

  • Present starting in MariaDB Shell 23.01.1.

22.12

  • Present starting in MariaDB Shell 22.12.1.

22.10

  • Present starting in MariaDB Shell 22.10.3.

EXTERNAL REFERENCES