TiDB Cloud Quick Start



Estimated completion time: 20 minutes

This tutorial guides you through an easy way to get started with TiDB Cloud.

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

Step 1: Create a TiDB Cloud Starter instance

TiDB Cloud Starter is the best way to get started with TiDB Cloud. To create a TiDB Cloud Starter instance, 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 My TiDB page is displayed by default.

  3. For new sign-up users, TiDB Cloud automatically creates a default TiDB Cloud Starter instance named Instance0 for you.

    • To instantly try out TiDB Cloud features with this default TiDB Cloud Starter instance, proceed to Step 2: Try SQL Editor.

    • To create a new TiDB Cloud Starter instance on your own, follow these steps:

      1. Click Create Resource.

      2. On the Create Resource page, Starter is selected by default. Enter a name for the TiDB Cloud Starter instance, select the cloud provider and target region, and then click Create. Your TiDB Cloud Starter instance will be created in approximately 30 seconds.

Step 2: Try SQL Editor

For TiDB Cloud Starter instances hosted on AWS, you can use the built-in SQL Editor in the TiDB Cloud console to maximize your data value. This enables you to run SQL queries against databases without a local SQL client. You can intuitively view the query results in tables or charts and easily check the query logs.

  1. On the My TiDB page, click the name of your TiDB Cloud Starter instance to go to its overview page, and then click SQL Editor in the left navigation pane.

  2. Write SQL queries in SQL Editor.

    For example, you can run the following SQL statements to create a table, insert data, and query the data:

    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`;
  3. Run the SQL queries.

      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.

    Step 3: Try guided tour on the console

    TiDB Cloud offers an interactive tutorial with carefully crafted sample datasets to help you quickly get started with TiDB Cloud. For TiDB Cloud Starter instances hosted on AWS, you can try this tutorial to learn how to use TiDB Cloud for high-performance data analytics.

    1. Click the ? icon in the lower-right corner of the console and select Guided tour of SQL Editor.
    2. Choose a TiDB Cloud Starter instance that you want to use for the tour, and click Import Dataset. The import process might take approximately one minute.
    3. Once the sample data is imported, follow the on-screen instructions to complete the tour.

    Step 4: Connect to your TiDB Cloud Starter instance

    TiDB is highly compatible with the MySQL protocol, so you can connect to it using most MySQL tools, drivers, and ORMs. The following steps use the MySQL CLI client mysql as an example.

    1. Navigate to the My TiDB page, and then click the name of your target TiDB Cloud Starter instance to go to its overview page.
    2. Click Connect in the upper-right corner. A connection dialog is displayed with connection parameters.
    3. Ensure that the configurations in the connection dialog match your operating environment.
    4. Click Generate Password to create a random password.
    5. In the Connect With drop-down list, select MySQL CLI.
    6. Copy the connection command, paste it into your terminal, and then press Enter to run it.

    The MySQL CLI client opens and connects to your TiDB Cloud Starter instance.

    What's next

    Was this page helpful?