Connect to TiDB Cloud Serverless via Public Endpoint
This document describes how to connect to your TiDB Cloud Serverless cluster via a public endpoint, using a SQL client from your computer, as well as how to disable a public endpoint.
Connect via a public endpoint
To connect to a TiDB Cloud Serverless cluster via public endpoint, take the following steps:
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 dialog, keep the default setting of the connection type as
Public
, and select your preferred connection method and operating system to get the corresponding connection string.TiDB Cloud Serverless lets you create branches for your cluster. After a branch is created, you can choose to connect to the branch via the Branch drop-down list.
main
represents the cluster itself.If you have not set a password yet, click Generate Password to generate a random password. The generated password will not show again, so save your password in a secure location.
Connect to your cluster with the connection string.
Disable a public endpoint
If you do not need to use a public endpoint of a TiDB Cloud Serverless cluster, you can disable it to prevent connections from the internet:
Navigate to the Clusters page, and then click the name of your target cluster to go to its overview page.
Click Networking in the left navigation pane and click Disable in the right pane. A confirmation dialog is displayed.
Click Disable in the confirmation dialog.
After disabling the public endpoint, the Public
entry in the Connection Type drop-down list of the connect dialog is disabled. If users are still trying to access the cluster from the public endpoint, they will get an error.
You can re-enable the public endpoint after disabling it:
Navigate to the Clusters page, and then click the name of your target cluster to go to its overview page.
Click Networking in the left navigation pane and click Enable in the right pane.
What's next
After you have successfully connected to your TiDB cluster, you can explore SQL statements with TiDB.