Estimated completion time: 20 minutes
This tutorial guides you through an easy way to get started with your TiDB Cloud. The content includes how to create a cluster, try playground, load your data, and connect to your cluster.
TiDB Cloud Serverless Tier (Beta) is the best way to get started with TiDB Cloud. To create a free Serverless Tier cluster, take the following steps:
If you do not have a TiDB Cloud account, click here to sign up for an account.
For Google or GitHub users, you can also sign up with your Google or GitHub account. Your email address and password will be managed by Google or GitHub and cannot be changed using the TiDB Cloud console.
Log in to your TiDB Cloud account.
The plan selection page is displayed by default.
On the plan selection page, click Get Started for Free in the Serverless Tier plan.
On the Create Cluster page, Serverless Tier is selected by default. Update the default cluster name if necessary, and then select the region where you want to create your cluster.
Your TiDB Cloud cluster will be created in several minutes.
During the creation process, perform security settings for your cluster:
- Click Security Settings in the upper-right corner of the cluster area.
- In the Security Settings dialog box, set a root password to connect to your cluster, and then click Apply. If you do not set a root password, you cannot connect to the cluster.
After your TiDB Cloud cluster is created, you can quickly start experimenting with TiDB using the pre-loaded sample data on TiDB Cloud.
On the Clusters page, click Playground to run queries instantly on TiDB Cloud.
After trying Plaground, you can load sample data to your TiDB Cloud cluster. We provide Capital Bikeshare sample data for you to easily import data and run sample queries.
Navigate to the Clusters page.
In the area of your newly created cluster, click ... in the upper-right corner and select Import Data. The Data Import page is displayed.
Fill in the import parameters:
- Data Format: select SQL File
- Bucket URI:
- Role ARN:
If the region of the bucket is different from your cluster, confirm the compliance of cross region. Click Next.
Add the table filter rules if needed. For the sample data, you can skip this step. Click Next.
On the Preview page, confirm the data to be imported and then click Start Import.
The data import process will take several minutes. When the data import progress shows Finished, you have successfully imported the sample data and the database schema to your database in TiDB Cloud.
After loading data to the cluster, you can connect to your cluster from the command line or with a programming language.
Navigate to the Clusters page.
In the area of your newly created cluster, click Connect in the upper-right corner. A connection dialog is displayed.
Follow the instructions in the dialog to connect to your TiDB cluster.
Create traffic filter for your connection.
Use a SQL client to connect to your cluster. Click the tab of your preferred connection method, and then connect to your cluster with the connection string.
After logging into your TiDB cluster, you can use the following SQL statement to validate the connection:
If you see the release version information, you are ready to use your TiDB cluster.
After connecting to your TiDB cluster, you can run some queries in your Terminal.
bikesharedatabase and tables:
USE bikeshare; SHOW tables;
Check the structure of the
Check how many records exist in the
SELECT COUNT(*) FROM trips;
Check the entire trip history where the start station is "8th & D St NW":
SELECT * FROM trips WHERE start_station_name = '8th & D St NW';
Show the least ten popular bicycle stations for picking up:
SELECT start_station_name, COUNT(ride_id) as count from `trips` GROUP BY start_station_name ORDER BY count ASC LIMIT 10;
For more details on TiDB SQL usage, see Explore SQL with TiDB.