Connect to TiDB with Navicat

TiDB is a MySQL-compatible database, and Navicat is a GUI tool set for database users. This tutorial uses the Navicat for MySQL tool to connect to TiDB.

In this tutorial, you can learn how to connect to your TiDB cluster using Navicat.

Prerequisites

To complete this tutorial, you need:

  • Navicat for MySQL 16.3.2 or later versions.
  • A paid account for Navicat for MySQL.
  • A TiDB cluster.

If you don't have a TiDB cluster, you can create one as follows:

Connect to TiDB

Connect to your TiDB cluster depending on the TiDB deployment option you have selected.

  • TiDB Serverless
  • TiDB Dedicated
  • TiDB Self-Hosted
  1. Navigate to the Clusters page, and then click the name of your target cluster to go to its overview page.

  2. Click Connect in the upper-right corner. A connection dialog is displayed.

  3. Ensure the configurations in the connection dialog match your operating environment.

    • Endpoint Type is set to Public.
    • Branch is set to main.
    • Connect With is set to Navicat.
    • Operating System matches your environment.
  4. Click Generate Password to create a random password.

  5. Launch Navicat for MySQL, click Connection in the upper-left corner, and select MySQL from the drop-down list.

    Navicat: add new connection

  6. In the New Connection (MySQL) dialog, configure the following connection parameters:

    • Connection Name: give this connection a meaningful name.
    • Host: enter the HOST parameter from the TiDB Cloud connection dialog.
    • Port: enter the PORT parameter from the TiDB Cloud connection dialog.
    • User Name: enter the USERNAME parameter from the TiDB Cloud connection dialog.
    • Password: enter the password of the TiDB Serverless cluster.

    Navicat: configure connection general panel for TiDB Serverless

  7. Click the SSL tab and select Use SSL, Use authentication, and Verify server certificate against CA checkboxes. Then, select the CA file from the TiDB Cloud connection dialog into the CA Certificate field.

    Navicat: configure connection SSL panel for TiDB Serverless

  8. Click Test Connection to validate the connection to the TiDB Serverless cluster.

  9. If the connection test is successful, you can see the Connection Successful message. Click Save to finish the connection configuration.

  1. Navigate to the Clusters page, and then click the name of your target cluster to go to its overview page.

  2. Click Connect in the upper-right corner. A connection dialog is displayed.

  3. Click Allow Access from Anywhere.

    For more details about how to obtain the connection string, refer to TiDB Dedicated standard connection.

  4. Click Download CA cert to download the CA file.

  5. Launch Navicat for MySQL, click Connection in the upper-left corner, and select MySQL from the drop-down list.

    Navicat: add new connection

  6. In the New Connection (MySQL) dialog, configure the following connection parameters:

    • Connection Name: give this connection a meaningful name.
    • Host: enter the HOST parameter from the TiDB Cloud connection dialog.
    • Port: enter the PORT parameter from the TiDB Cloud connection dialog.
    • User Name: enter the USERNAME parameter from the TiDB Cloud connection dialog.
    • Password: enter the password of the TiDB Dedicated cluster.

    Navicat: configure connection general panel for TiDB Dedicated

  7. Click the SSL tab and select Use SSL, Use authentication, and Verify server certificate against CA checkboxes. Then, select the CA file downloaded in step 4 into the CA Certificate field.

    Navicat: configure connection SSL panel for TiDB Dedicated

  8. Test Connection to validate the connection to the TiDB Dedicated cluster.

  9. If the connection test is successful, you can see the Connection Successful message. Click Save to finish the connection configuration.

  1. Launch Navicat for MySQL, click Connection in the upper-left corner, and select MySQL from the drop-down list.

    Navicat: add new connection

  2. In the New Connection (MySQL) dialog, configure the following connection parameters:

    • Connection Name: give this connection a meaningful name.
    • Host: enter the IP address or domain name of your TiDB Self-Hosted cluster.
    • Port: enter the port number of your TiDB Self-Hosted cluster.
    • User Name: enter the username to use to connect to your TiDB.
    • Password: enter the password to use to connect to your TiDB.

    Navicat: configure connection general panel for self-hosted TiDB

  3. Click Test Connection to validate the connection to the TiDB Self-Hosted cluster.

  4. If the connection test is successful, you can see the Connection Successful message. Click Save to finish the connection configuration.

Next steps

Need help?

Ask questions on the Discord, or create a support ticket.