2.6. mysql Output Formats


2.6. mysql Output Formats

By default, mysql produces output in one of two formats, depending on whether you use it in interactive or batch mode:

  • When invoked interactively, mysql displays query output in a tabular format that uses bars and dashes to display values lined up in boxed columns.

  • When you invoke mysql with a file as its input source on the command line, mysql runs in batch mode with query output displayed using tab characters between data values.

To override the default output format, use these options:

  • --batch or -B

    Produce batch mode (tab-delimited) output, even when running interactively.

  • --table or -t

    Produce tabular output format, even when running in batch mode.

In batch mode, you can use the --raw or -r option to suppress conversion of characters such as newline and carriage return to escape-sequences such as \n or \r. In raw mode, the characters are printed literally.

To select an output format different from either of the default formats, use these options:

  • --html or -H

    Produce output in HTML format.

  • --xml or -X

    Produce output in XML format.



MySQL 5 Certification Study Guide
MySQL 5.0 Certification Study Guide
ISBN: 0672328127
EAN: 2147483647
Year: 2006
Pages: 312

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net