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 Cloud Serverless is the best way to get started with TiDB Cloud. To create a TiDB Cloud Serverless cluster, follow these steps:
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.
Log in to your TiDB Cloud account.
The Clusters page is displayed by default.
For new sign-up users, TiDB Cloud automatically creates a default TiDB Cloud Serverless cluster named
Cluster0
for you.To instantly try out TiDB Cloud features with this default cluster, proceed to Step 2: Try AI-assisted SQL Editor.
To create a new TiDB Cloud Serverless cluster on your own, follow these steps:
- Click Create Cluster.
- On the Create Cluster page, Serverless is selected by default. Select the target region for your cluster, update the default cluster name if necessary, select your cluster plan, and then click Create. Your TiDB Cloud Serverless cluster will be created in approximately 30 seconds.
Step 2: Try AI-assisted SQL Editor
You can use the built-in AI-assisted 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.
On the Clusters page, click on a cluster name to go to its overview page, and then click SQL Editor in the left navigation pane.
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.
In SQL Editor, press ⌘ + I on macOS (or Control + I on Windows or Linux) to instruct Chat2Query (beta) to generate SQL queries automatically.
For example, to create a new table
test.t
with two columns (columnid
and columnname
), you can typeuse test;
to specify the database, press ⌘ + I, typecreate 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 clicking Accept and then further edit it if needed, or reject it by clicking Discard.
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.
- Click on the ? icon in the lower-right corner of the console and select Interactive Tutorials.
- In the tutorials list, select a tutorial card to start, such as Steam Game Stats.
- Choose a TiDB Cloud Serverless cluster that you want to use for the tutorial, and click Import Dataset. The import process might take approximately one minute.
- Once the sample data is imported, follow the on-screen instructions to complete the tutorial.
What's next
- To learn how to connect to your cluster using different methods, see Connect to a TiDB Cloud Serverless cluster.
- For more information about how to use SQL Editor and Chat2Query to explore your data, see Explore your data with AI-assisted SQL Editor.
- For TiDB SQL usage, see Explore SQL with TiDB.
- For production use with the benefits of cross-zone high availability, horizontal scaling, and HTAP, see Create a TiDB Cloud Dedicated cluster.