MySQL Client Options

MySQLMySQLi Database

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.

--auto-rehash

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

--auto-vertical-output

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

--binary-as-hex

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.

--bind-address=ip_address

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.

--character-sets-dir=dir_name

It is the directory where character sets are installed.

--column-names

It is used to write column names in results.

--column-type-info

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.

raja
Published on 10-Mar-2021 17:16:32
Advertisements