| tenant-type | | slug | quick-start-obclient |
Basic connection method
Call the client from the command interpreter prompt (for example, cmd on Windows or Terminal on macOS). If no connection parameters are specified and TCP is used, OBClient connects to 127.0.0.1:2881 by default, with the user being root@sys (see Product overview).
To connect to a specific database:
obclient -h127.0.0.1 -P2881 -uroot@sys -Dtest -p
Enter an SQL statement, ending it with a semicolon (;), \g, or \G, then press Enter.
Pressing Control-C terminates the current statement in OBClient. If you cannot complete the statement, or if you press Control-C again before the statement is terminated, OBClient exits.
You can execute SQL statements in script files (batch files), as shown below:
obclient db_name < script.sql > output.tab
