TiDB Cloud Quick Start

TiDB Cloud provides an easy way to host and manage your data in the cloud. This tutorial guides you through signing up, creating a cluster, connecting to a cluster, and migrating data from MySQL.

Step 1. Create a TiDB cluster

  1. Sign up and log in to TiDB Cloud.

    Visit https://tidbcloud.com/signup to sign up for a TiDB Cloud account.

    If you have already signed up, visit https://tidbcloud.com and log in either using your registered email and password, or Google account.

  2. Select a cloud provider.

    Click the cloud service provider icon on the left of the top navigation bar, and select your preferred cloud provider. The existing options are Amazon Web Services and Google Cloud.

  3. Click Create a Cluster, set a Cluster Name and a Root Password.

  4. Confirm your Cloud Provider and select Region.

  5. Select Cluster Tier and the number of nodes.

    The selected cluster tier will determine the throughput and performance of your clusters. Once created, you cannot change the cluster tier.

    1. Select Cluster Tier from the following options.

      Note:

      Free trial users for TiDB Cloud Public Preview can select only the T3.standard cluster tier. See Select Your Cluster Tier for details.

      • T3.standard

        Default recommended setup for general Online Transactional Processing (OLTP) production environments.

      • H3.standard

        Hybrid Transaction/Analytical Processing (HTAP) cluster setup to store both transactional and analytical data in the same cluster, with real time replication between the row store and columnar store. This cluster consists of TiKV and TiFlash, a columnar storage designed for analytical processing.

    2. Select the number of nodes by clicking the plus or the minus sign.

      Note:

      Free trial users cannot increase or decrease number of nodes.

  6. Click Submit.

    Your TiDB Cloud cluster will be created in approximately 5-15 minutes.

Step 2. Connect to your TiDB cluster

After your TiDB cluster is created, you can connect to your TiDB cluster via Standard connection. See Connect to Your TiDB Cluster for details.

To connect to your TiDB cluster via standard connection, perform the following steps:

  1. Navigate to the TiDB Clusters page and find your newly created cluster.

  2. Click Connect. The Connect to TiDB dialog displays.

  3. Create the traffic filter for the cluster.

    The traffic filter is a list of IPs and CIDR addresses that are allowed to access TiDB Cloud via a SQL client. If it is the first time that you connect to the cluster, the traffic filter is empty by default. Perform the following sub-steps to add one. If the traffic filter is already set, skip this step.

    1. Click one of the following buttons to add some rules quickly.

      • Add Your Current IP Address
      • Add Rules from Default Set
      • Allow Access from Anywhere
    2. Provide an optional description for the newly added IP address or CIDR range.

    3. Click Create Filter to confirm the changes.

  4. Use a SQL client to connect to TiDB.

    mysql -u root -h <endpoint> -P 4000 -p

Now you can explore SQL with TiDB.

Step 3. Import data

You can import sample data using the UI import tool, or import your data using TiDB Lightning.

Import sample data using the UI import tool

  1. On the TiDB Cloud console, click Import in the upper right of the pane of the cluster that you want to import data into. The Data Import page displays.

  2. For Data Source Type, select AWS S3.

  3. In the Bucket URL field, enter the sample data URL s3://tidbcloud-samples/data-ingestion/.

  4. For Bucket Region, select US West (Oregon). The sample data bucket is hosted in the US West (Oregon) region.

  5. For Data Format, select TiDB Dumpling.

  6. For Target Database, enter root in the Username field, and enter the root password you have set when you created the cluster in the Password field.

    Note:

    If you have created a custom user and have the enough permissions, you can also use the name of the newly created user and the corresponding password.

  7. Leave the DB/Tables Filter field blank.

  8. Click Import. Then the sample data starts being imported.

Once the cluster finishes the data importing process, you will get the sample data in your database.

You can run some queries to check the result, for example:

  1. Get the trip records starting at "12th & U St NW":

    use bikeshare;
    select * from `trips` where start_station_name='12th & U St NW' limit 10;
  2. Get the trip records with electric bikes:

    use bikeshare;
    select * from `trips` where rideable_type='electric_bike' limit 10;

Import data using TiDB Lightning

See Migrate Data from MySQL-Compatible Databases using the Dumpling and TiDB Lightning tools.