TiDBTiDB Docs Dash 2024

Jan 9 - Jan 12 (UTC)
Join us to improve docs and win a prize!
Sign InTry Free

TiDB Cloud CLI Quick Start

TiDB Cloud provides a command-line interface (CLI) ticloud for you to interact with TiDB Cloud from your terminal with a few lines of commands. For example, you can easily perform the following operations using ticloud:

  • Create, delete, and list your clusters.
  • Import data from Amazon S3 or local files to your clusters.

Before you begin

Installation

  • macOS/Linux
  • Windows

For macOS or Linux, you can install ticloud using any of the following methods:

  • Install via script (recommended)

    curl https://raw.githubusercontent.com/tidbcloud/tidbcloud-cli/main/install.sh | sh
  • Install via TiUP

    tiup install cloud
  • Install manually

    Download the pre-compiled binaries from the releases page and copy them to your desired location for installation.

  • Install in GitHub Actions

    To set up ticloud in GitHub Action, use setup-tidbcloud-cli.

Install the MySQL command-line client if you do not have it. You can install it via your package manager:

  • Debian-based distributions:

    sudo apt-get install mysql-client
  • RPM-based distributions:

    sudo yum install mysql
  • macOS:

    brew install mysql-client

For Windows, you can install ticloud using either of the following methods:

  • Install manually

    Download the pre-compiled binaries from the releases page and copy them to the desired location for installation.

  • Install in GitHub Actions

    To set up ticloud in GitHub Actions, use setup-tidbcloud-cli.

Install the MySQL command-line client if you do not have it. You can refer to the instructions in MySQL Installer for Windows for the installation. To launch ticloud connect on Windows, you need to have the directory containing mysql.exe in the PATH environment variable.

Use the TiDB Cloud CLI

View all commands available:

ticloud --help

Verify that you are using the latest version:

ticloud version

If not, update to the latest version:

ticloud update

Use the TiDB Cloud CLI through TiUP

The TiDB Cloud CLI is also available through TiUP, with the component name as cloud.

View all commands available:

tiup cloud --help

Run commands with tiup cloud <command>. For example:

tiup cloud cluster create

Update to the latest version by TiUP:

tiup update cloud

Quick start

TiDB Serverless is the best way to get started with TiDB Cloud. In this section, you will learn how to create a TiDB Serverless cluster with TiDB Cloud CLI.

Create a user profile

Before creating a cluster, you need to create a user profile with your TiDB Cloud API Key:

ticloud config create

Create a TiDB Serverless cluster

To create a TiDB Serverless cluster, enter the following command, and then follow the CLI prompts to provide the required information and set the password:

ticloud cluster create

Connect to the cluster

After the cluster is created, you can connect to the cluster:

ticloud connect

When you are prompted about whether to use the default user, choose Y and enter the password that you set when creating the cluster.

What's next

Check out CLI reference to explore more features of TiDB Cloud CLI.

Feedback

If you have any questions or suggestions on the TiDB Cloud CLI, feel free to create an issue. Also, we welcome any contributions.

Was this page helpful?

Download PDFRequest docs changesAsk questions on Discord
Playground
New
One-stop & interactive experience of TiDB's capabilities WITHOUT registration.
Products
TiDB
TiDB Dedicated
TiDB Serverless
Pricing
Get Demo
Get Started
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.