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 cluster
TiDB Cloud Serverless (now Starter) is the best way to get started with TiDB Cloud. To create a TiDB Cloud Starter 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 Starter 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 Starter cluster on your own, follow these steps:
Click Create Cluster.
On the Create Cluster page, Starter is selected by default. Select the cloud provider and target region for your cluster, update the default cluster name if necessary, and then click Create. Your TiDB Cloud Starter cluster will be created in approximately 30 seconds.
Step 2: Try AI-assisted SQL Editor
For TiDB Cloud Starter clusters hosted on AWS, 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 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 AWS Bedrock 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.
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 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 clusters hosted on AWS, you can try this tutorial to learn how to use TiDB Cloud for high-performance data analytics.
- Click the ? icon in the lower-right corner of the console and select Guided tour of SQL Editor.
- Choose a TiDB Cloud Starter cluster that you want to use for the tour, 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 tour.
What's next
- To learn how to connect to your cluster using different methods, see Connect to a TiDB Cloud Starter or Essential 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.