Sign InTry Free

TiDB Cloud Quick Start

Estimated completion time: 20 minutes

This tutorial guides you through an easy way to get started with TiDB Cloud. You can also follow the step-by-step tutorials on the Getting Started page in the TiDB Cloud console.

Additionally, you can try out TiDB features on TiDB Playground.

Step 1: Create a TiDB cluster

TiDB Serverless is the best way to get started with TiDB Cloud. To create a TiDB Serverless cluster, follow these steps:

  1. If you do not have a TiDB Cloud account, click here to sign up.

    You can sign up with your email and password to manage your password using TiDB Cloud, or choose to sign in with your Google, GitHub, or Microsoft account for single sign-on (SSO) to TiDB Cloud.

  2. Log in to your TiDB Cloud account.

    The Clusters page is displayed by default.

  3. For new sign-up users, TiDB Cloud automatically creates a default TiDB Serverless cluster named Cluster0 for you.

    • To instantly try out TiDB Cloud features with this default cluster, proceed to Step 2: Try AI-powered Chat2Query (beta).

    • To create a new TiDB Serverless cluster on your own, follow these steps:

      1. Click Create Cluster.
      2. On the Create Cluster page, Serverless is selected by default. Select the target region for your cluster, update the default cluster name if necessary, and then click Create. Your TiDB Serverless cluster will be created in approximately 30 seconds.

Step 2: Try AI-powered Chat2Query (beta)

TiDB Cloud is powered by AI. You can use Chat2Query (beta), an AI-powered SQL editor in the TiDB Cloud console, to maximize the value of your data.

In Chat2Query, you can either simply type -- followed by your instructions to let AI automatically generate SQL queries, or write SQL queries manually and run them against databases without using a terminal.

  1. On the Clusters page, click on a cluster name to go to its overview page, and then click Chat2Query in the left navigation pane.

  2. To try the AI capacity of TiDB Cloud, follow the on-screen instructions to allow PingCAP and OpenAI to use your code snippets for research and service improvement, and then click Save and Get Started.

  3. In the editor, you can either simply type -- followed by your instructions to let AI automatically generate SQL queries, or write SQL queries manually.

    For example, to create a new table test.t with two columns (column id and column name), you can type use test; to specify the database, type -- create a new table t with id and name as the instruction, and then press Enter to let AI generate a SQL statement accordingly.

    For the generated statement, you can accept it by pressing Tab and then further edit it if needed, or reject it by pressing Esc.

  4. Run the SQL queries.

    • macOS
    • Windows/Linux

    For macOS:

    • If you have only one query in the editor, press ⌘ + Enter or click Run to execute it.

    • If you have multiple queries in the editor, select the lines of the target queries with your cursor, and then press ⌘ + Enter or click Run to execute them sequentially.

    • To run all queries in the editor sequentially, press ⇧ + ⌘ + Enter, or select the lines of all queries with your cursor and click Run.

    For Windows or Linux:

    • If you have only one query in the editor, press Ctrl + Enter or click Run to execute it.

    • If you have multiple queries in the editor, select the lines of the target queries with your cursor, and then press Ctrl + Enter or click Run to execute them sequentially.

    • To run all queries in the editor sequentially, press Shift + Ctrl + Enter, or select the lines of all queries with your cursor and click Run.

After running the queries, you can immediately see the query logs and results at the bottom of the page.

To let AI generate more SQL statements, you can type more instructions as shown in the following example:

use test; -- create a new table t with id and name CREATE TABLE `t` (`id` INT, `name` VARCHAR(255)); -- add 3 rows INSERT INTO `t` (`id`, `name`) VALUES (1, 'row1'), (2, 'row2'), (3, 'row3'); -- query all SELECT `id`, `name` FROM `t`;

Step 3: Try interactive tutorials

TiDB Cloud offers interactive tutorials with carefully crafted sample datasets to help you quickly get started with TiDB Cloud. You can try these tutorials to learn how to use TiDB Cloud for high-performance data analytics.

  1. Click on the ? icon in the lower-right corner of the console and select Interactive Tutorials.
  2. In the tutorials list, select a tutorial card to start, such as Steam Game Stats.
  3. Choose a TiDB Serverless cluster that you want to use for the tutorial, and click Import Dataset. The import process might take approximately one minute.
  4. Once the sample data is imported, follow the on-screen instructions to complete the tutorial.

What's next

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.