All Products
Search
Document Center

Lindorm:Connect to and use LindormTable with Lindorm-cli

Last Updated:Mar 30, 2026

Lindorm-cli is a command-line interface (CLI) for connecting to and managing LindormTable. It supports interactive mode for live SQL execution and non-interactive mode for scripting and automation. Query results can be displayed in the terminal or exported to a file in multiple formats, including CSV and JSON.

Prerequisites

Before you begin, make sure that:

  • The client IP address is added to the Lindorm whitelist.

  • You have selected a network type for connecting to LindormTable.

The following network types are supported:

Network type Description
Virtual private cloud (VPC) (Recommended) A VPC is your private network on the cloud, isolated at Layer 2 for high security. Deploy Lindorm-cli on an ECS instance in the same VPC for lower latency and better security.
Public network Use the public network to connect from an on-premises device for testing or management. No traffic fees apply, but security risks are higher than a VPC connection. Before connecting, enable the public endpoint in the console. For details, see Enable the public endpoint.

Install Lindorm-cli

  1. Download the Lindorm-cli package for your operating system.

    Note

    Use the SHA256 checksums to verify the integrity of the downloaded package.

    Operating system Download link SHA256 checksum
    Linux lindorm-cli for Linux<br><br>Direct download: wget https://tsdbtools.oss-cn-hangzhou.aliyuncs.com/lindorm-cli-linux-latest.tar.gz 0f4ccaf214b41fdf8d3dd5f0ed4f92f1d5e6b0a11da3d217c9df6d382f0080df
    Linux (arm64) lindorm-cli for Linux arm64<br><br>Direct download: wget https://tsdbtools.oss-cn-hangzhou.aliyuncs.com/lindorm-cli-linux-arm64-latest.tar.gz 1bfb992853a26c703b2d9e2bd50e4d7e31f88992bcb7e70ac30331f5998c269e
    Mac (Intel chip) lindorm-cli for Mac (Intel) af8a78bfe8ef53d1df25df99b5803ef3f55da7e943d730a1a6d44cd918f28842
    Mac (Arm chip) lindorm-cli for Mac (Arm) 5bdc8600055432a9275a0d52e5d26e6c2cfc7a553961c09681d0388a5a5e9a62
    Windows lindorm-cli for Windows x64 7721748744edc551d43fec6bb19ab40eb514bb6043a3d21afa38f353833259ce
  2. Decompress the package using the standard method for your operating system. On Linux, run:

    tar zxvf lindorm-cli-linux-latest.tar.gz

    After decompression, an executable file named lindorm-cli is generated. Run it directly in a shell terminal — no additional installation required.

Connect to LindormTable

Lindorm-cli supports two connection protocols: MySQL protocol (recommended) and Avatica protocol. The connection command syntax is the same across protocols — only the URL format differs.

Important

Only Lindorm-cli 2.0.0 and later supports the MySQL protocol.

Synopsis

# Connect and enter interactive mode (Linux/macOS)
./lindorm-cli -url <url> -username <username> -password <password>

# Connect and enter interactive mode (Windows CMD)
lindorm-cli -url <url> -username <username> -password <password>

# Run a single SQL statement and exit (non-interactive)
./lindorm-cli -url <url> -username <username> -password <password> -execute "<sql>"

# Exit interactive mode
exit  |  quit  |  Ctrl+D

Connection parameters

Parameter Description
url The endpoint URL. For the MySQL protocol, use the MySQL-compatible endpoint (port 33060). For the Avatica protocol, use the LindormTable SQL endpoint (port 30060).
username The LindormTable username.
password The password for the username. If you forget the password, reset it in the LindormTable cluster management system, then restart the engine in the console.
database (Optional) The database to connect to. Defaults to the default database.

Connect using the MySQL protocol (recommended)

Linux and macOS

Navigate to the directory containing lindorm-cli and run:

./lindorm-cli -url <mysql-endpoint>:33060 -username <username> -password <password>

A successful connection prints:

lindorm-cli version: 2.0.x

Connection options

You can extend the URL with a mysql:// protocol prefix or server-side parameters:

Option Format Example
mysql:// prefix mysql://<endpoint>:<port> mysql://ld-8vbn68478unu8****-proxy-sql-lindorm.lindorm.rds.aliyuncs.com:33060
Query timeout <endpoint>:<port>?operationTimeout=<ms> ld-bp187uwcx5f40****-proxy-lindorm-vpc.lindorm.aliyuncs.com:33060?operationTimeout=120000
Important

The operationTimeout parameter requires LindormTable engine version 2.7.7 or later. To check or upgrade your version, see LindormTable version guide and Perform a minor version update.

Examples

# Basic connection
./lindorm-cli -url ld-bp187uwcx5f40****-proxy-lindorm-vpc.lindorm.aliyuncs.com:33060 -username user -password test

# With mysql:// prefix
./lindorm-cli -url mysql://ld-bp187uwcx5f40****-proxy-lindorm-vpc.lindorm.aliyuncs.com:33060 -username user -password test

# With a 120-second query timeout
./lindorm-cli -url mysql://ld-bp187uwcx5f40****-proxy-lindorm-vpc.lindorm.aliyuncs.com:33060?operationTimeout=120000 -username user -password test

Windows

Method 1: Command Prompt

  1. Open Command Prompt and navigate to the directory containing lindorm-cli.exe:

    cd <folder_of_lindorm-cli.exe>
  2. Run the connection command:

    lindorm-cli -url <mysql-endpoint>:33060 -username <username> -password <password>

    A successful connection prints:

    Connected to ld-bp187uwcx5f40****-proxy-sql-lindorm-public.lindorm.rds.aliyuncs.com:33060
    lindorm-cli version: 2.0.x

    The connection options and examples described for Linux and macOS also apply to Windows Command Prompt.

Method 2: Double-click

Double-click lindorm-cli.exe to open a command prompt window. This starts the interactive interface without an initial connection. Run the connect subcommand to establish one:

connect <mysql-endpoint>:33060 <username> <password>

Example:

connect ld-bp13y790c91f4****-proxy-lindorm-pub.lindorm.aliyuncs.com:33060 user test

A successful connection produces no output.

Connect using the Avatica protocol

Linux and macOS

./lindorm-cli -url jdbc:lindorm:table:url=http://<lindormtable-sql-endpoint>:30060 -username <username> -password <password>

Example:

./lindorm-cli -url jdbc:lindorm:table:url=http://ld-bp17j28j2y7pm****-proxy-lindorm-pub.lindorm.rds.aliyuncs.com:30060 -username user -password test

A successful connection prints:

lindorm-cli version: 2.0.xx

Windows

Method 1: Command Prompt

lindorm-cli -url jdbc:lindorm:table:url=http://<lindormtable-sql-endpoint>:30060 -username <username> -password <password>

Example:

lindorm-cli -url jdbc:lindorm:table:url=http://ld-bp13y790c91f4****-proxy-lindorm-pub.lindorm.aliyuncs.com:30060 -username user -password test

A successful connection prints:

Connected to jdbc:lindorm:table:url=http://ld-bp13y790c91f4****-proxy-lindorm-pub.lindorm.rds.aliyuncs.com:30060
lindorm-cli version: 2.0.xx

Method 2: Double-click

Double-click lindorm-cli.exe, then run:

connect jdbc:lindorm:table:url=http://<lindormtable-sql-endpoint>:30060 <username> <password>

Example:

connect jdbc:lindorm:table:url=http://ld-bp13y790c91f4****-proxy-lindorm-pub.lindorm.aliyuncs.com:30060 user test

A successful connection produces no output.

Run SQL statements

Interactive mode

After connecting, Lindorm-cli enters an interactive prompt and waits for SQL input.

image.png
Note

On Windows, double-clicking lindorm-cli.exe opens the interactive interface without a connection. Use the connect subcommand to connect before running SQL statements.

Enter SQL statements at the prompt to create databases, create tables, write data, and query data:

image.png

For supported SQL syntax, see SQL reference.

To exit, run exit or quit, or press Ctrl+D.

Note

Lindorm-cli maintains a single session for the duration of your connection. All SQL operations within a session share the same context. If the session is idle for an extended period, the server automatically closes the connection.

Non-interactive mode

In non-interactive mode, Lindorm-cli runs a single SQL statement and exits — no interactive prompt appears. Each statement uses its own short-lived connection. This mode is suitable for automation scripts and scheduled tasks.

Append -execute "<sql>" to the connection command:

lindorm-cli -url mysql://ld-xxxxxx-proxy-lindorm-vpc.lindorm.aliyuncs.com:33060 -username user -password XXXX -execute "CREATE TABLE tb (id VARCHAR, name VARCHAR, address VARCHAR, PRIMARY KEY(id, name));"
image.png

By default, results print to standard output (stdout). To write results to a file, use -output:

lindorm-cli -url mysql://ld-xxxxxx-proxy-lindorm-vpc.lindorm.aliyuncs.com:33060 -username user -password XXXX -format csv -output ~/result.csv -execute "SELECT * FROM tb;"
Important

Exporting to CSV requires Lindorm-cli 2.2.0 or later. To check your version, run lindorm-cli -version or check the startup message in interactive mode.

Command-line parameters

All parameters must be prefixed with a hyphen (-).

Connection parameters

Parameter Requires a value Description
url Yes The endpoint URL and protocol. For the MySQL protocol, use the MySQL-compatible endpoint. For the Avatica protocol, use the LindormTable SQL endpoint.
username Yes The username for the connection. Must be a user created in LindormTable.
password Yes The password for the username.
database Yes The database to connect to. Defaults to the default database if not specified.
version No Prints the Lindorm-cli version and exits. Does not start the interactive interface.

Execution and output parameters

Parameter Requires a value Description
execute Yes The SQL statement to run in non-interactive mode. Enclose the statement in single or double quotation marks. When using double quotes, escape any inner double quotes with a backslash (\). Single quotes do not support escape characters.
output Yes The file path for writing results in non-interactive mode. Defaults to stdout. If the file does not exist, Lindorm-cli creates it.
format Yes The output format. Defaults to column. Options: column (standard table), horizontal (column by column), vertical (row by row, similar to MySQL's \G), csv, json.
pretty No Use with format=json. Outputs pretty-printed JSON instead of compressed JSON.
csvNoHeader No Use with format=csv. Omits the column name header row.
nullString Yes Use with format=csv. Replaces NULL values with the specified string. Default behavior: MySQL protocol represents NULL as \N; Avatica protocol represents NULL as an empty string.

Subcommands

In interactive mode, enter these subcommands at the prompt in addition to SQL statements:

Subcommand Parameters Description
connect <url> <username> <password> Establish a connection when Lindorm-cli started without one. The parameters have the same meaning as the -url, -username, and -password command-line parameters.
format horizontal, vertical, csv, or json Change the output format for subsequent results.
help List available subcommands.
history Show recently executed SQL statements and subcommands.
exit or quit Exit Lindorm-cli and close the connection.

FAQ

Why does the connection time out or fail?

A connection failure typically returns Failed to connect to <LindormTable endpoint> connection check failed or connection timeout.

Check the following causes:

Cause Solution
The client's public IP address is not in the whitelist. Add the IP to the Lindorm whitelist. To find your public IP, run curl ipinfo.io/ip or curl ifconfig.me.
The connection still times out after adding the IP to the whitelist. Network connectivity may be unstable. Switch to a VPC connection.
The ECS instance IP is not in the whitelist. Get the ECS instance IP address and add it to the Lindorm whitelist.
The wrong endpoint is used. VPC connections and public network connections use different endpoints. Check that you are using the correct one for your network environment.

If the issue persists, contact Lindorm technical support on DingTalk (ID: s0s3eg3).

What's next