title | summary |
---|---|
Connect to TiDB with Navicat |
Learn how to connect to TiDB using Navicat. |
TiDB is a MySQL-compatible database, and Navicat is a GUI tool set for database users. This tutorial uses the Navicat Premium tool to connect to TiDB.
In this tutorial, you can learn how to connect to your TiDB cluster using Navicat.
Note:
This tutorial is compatible with TiDB Cloud Serverless, TiDB Cloud Dedicated, and TiDB Self-Managed.
To complete this tutorial, you need:
- Navicat Premium 17.1.6 or later versions.
- A paid account for Navicat Premium.
- A TiDB cluster.
If you don't have a TiDB cluster, you can create one as follows:
- (Recommended) Follow Creating a TiDB Cloud Serverless cluster to create your own TiDB Cloud cluster.
- Follow Deploy a local test TiDB cluster or Deploy a production TiDB cluster to create a local cluster.
If you don't have a TiDB cluster, you can create one as follows:
- (Recommended) Follow Creating a TiDB Cloud Serverless cluster to create your own TiDB Cloud cluster.
- Follow Deploy a local test TiDB cluster or Deploy a production TiDB cluster to create a local cluster.
Connect to your TiDB cluster depending on the TiDB deployment option you have selected.
-
Navigate to the Clusters page, and then click the name of your target cluster to go to its overview page.
-
Click Connect in the upper-right corner. A connection dialog is displayed.
-
Ensure the configurations in the connection dialog match your operating environment.
- Connection Type is set to
Public
. - Branch is set to
main
. - Connect With is set to
Navicat
. - Operating System matches your environment.
- Connection Type is set to
-
Click Generate Password to create a random password.
Tip:
If you have created a password before, you can either use the original password or click Reset Password to generate a new one.
-
Launch Navicat Premium, click Connection in the upper-left corner, select PingCAP from the Venfor Filter list, and double-click TiDB in the right panel.
-
In the New Connection (TiDB) 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 Cloud Serverless cluster.
-
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. -
Click Test Connection to validate the connection to the TiDB Cloud Serverless cluster.
-
If the connection test is successful, you can see the Connection Successful message. Click OK to finish the connection configuration.
-
Navigate to the Clusters page, and then click the name of your target cluster to go to its overview page.
-
Click Connect in the upper-right corner. A connection dialog is displayed.
-
In the connection dialog, select Public from the Connection Type drop-down list.
If you have not configured the IP access list, click Configure IP Access List or follow the steps in Configure an IP Access List to configure it before your first connection.
In addition to the Public connection type, TiDB Dedicated supports Private Endpoint and VPC Peering connection types. For more information, see Connect to Your TiDB Dedicated Cluster.
-
Click CA cert to download the CA certificate.
-
Launch Navicat Premium, click Connection in the upper-left corner, select PingCAP from the Venfor Filter list, and double-click TiDB in the right panel.
-
In the New Connection (TiDB) 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 Cloud Dedicated cluster.
-
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.
-
Test Connection to validate the connection to the TiDB Cloud Dedicated cluster.
-
If the connection test is successful, you can see the Connection Successful message. Click OK to finish the connection configuration.
-
Launch Navicat Premium, click Connection in the upper-left corner, select PingCAP from the Venfor Filter list, and double-click TiDB in the right panel.
-
In the New Connection (TiDB) 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-Managed cluster.
- Port: enter the port number of your TiDB Self-Managed cluster.
- User Name: enter the username to use to connect to your TiDB.
- Password: enter the password to use to connect to your TiDB.
-
Click Test Connection to validate the connection to the TiDB Self-Managed cluster.
-
If the connection test is successful, you can see the Connection Successful message. Click OK to finish the connection configuration.
- Learn the best practices for TiDB application development with the chapters in the Developer guide, such as Insert data, Update data, Delete data, Single table reading, Transactions, and SQL performance optimization.
- Learn through the professional TiDB developer courses and earn TiDB certifications after passing the exam.
Ask the community on Discord or Slack, or submit a support ticket.
Ask the community on Discord or Slack, or submit a support ticket.