MySQL Client Options

The mysql supports the below mentioned options, which can be specified on the command line or in the [mysql] and [client] groups of an option file.

--help, -?

It helps display a help message and exit.


It enables automatic rehashing. This option is set by default, which enables database, table, and column name completion.


This option causes the result sets to be displayed vertically if they are too wide for the current window, and it uses the normal tabular format otherwise.

--batch, -B

It prints the results using tab as the column separator, with each row on a new line. With this option, mysql doesn’t use the history file.

Batch mode results in non-tabular output format and escaping of special characters. Escaping can be disabled with the help of raw mode


When this option is used, mysql displays binary data with the help of hexadecimal notation (0xvalue). This occurs irrespective of whether the overall output display format is tabular, vertical, HTML, or XML.


On a computer that has multiple network interfaces, this option is used to select which interface has to be used to connect to the MySQL server.


It is the directory where character sets are installed.


It is used to write column names in results.


It is used to display result set metadata. This information corresponds to the contents of C API MYSQL_FIELD data structures.

--comments, -c

It tells whether to strip or preserve comments in statements sent to the server. The default is --skip-comments (strip comments), enable with --comments (which is used preserve comments).

--compress, -C

It is used to compress all information that is sent between the client and the server if possible. As of MySQL 8.0.18, this option has been deprecated.

Updated on: 10-Mar-2021


Kickstart Your Career

Get certified by completing the course

Get Started