| tenant-type | | slug | common-command-line-options-obclient |
OBClient supports a rich set of command-line options. The following are the most commonly used options:
Options |
Description |
|---|---|
-h, --host=host |
The host to connect to. If not specified and TCP connection is used, the default value is 127.0.0.1. |
-P, --port=num |
The port number for the connection. If not specified and a TCP connection is used, the default value 2881 is used. |
-u, --user=name |
The username used for login. If not specified and TCP connection is used, the default is root@sys. |
-p, --password[=password] |
The password used to connect to the server. |
-D, --database=name |
The database to be used. |
-A, --no-auto-rehash |
No automatic rehashing, enabling faster OBClient startup. |
-B, --batch |
Use tabs as column separators to print results, suitable for batch processing mode. |
-e, --execute=name |
Execute the statement and exit. |
-q, --quick |
Results are not cached and are printed line by line. |
-s, --silent |
Quieter output mode. |
-t, --table |
The output is displayed in a table format. |
-E, --vertical |
Vertically print the query output. |
-v, --verbose |
Write more information. |
-V, --version |
Output the version information and exit. |
-?, --help |
Displays help information and exits. |
--login-path=name |
Log in using the login_path. |
--safe-updates |
Enable safe update mode to prevent accidental deletion or update of all rows. |
--local-infile |
Enable or disableLOAD DATA INFILEof the LOCAL feature. |
Notice
On Unix systems, localhost and 127.0.0.1 have different connection behaviors. When using localhost, OBClient attempts to use a Unix socket connection; when using 127.0.0.1, OBClient uses a TCP/IP connection. If your server listens only on TCP/IP ports, use 127.0.0.1 or the actual IP address.
