diff --git a/develop/dev-guide-gui-datagrip.md b/develop/dev-guide-gui-datagrip.md index cab767e4b3dbd..ac66c9916fb9a 100644 --- a/develop/dev-guide-gui-datagrip.md +++ b/develop/dev-guide-gui-datagrip.md @@ -10,7 +10,7 @@ TiDB is a MySQL-compatible database, and [JetBrains DataGrip](https://www.jetbra > **Note:** > -> This tutorial is compatible with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial is compatible with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. You can use DataGrip in two ways: @@ -75,6 +75,48 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 9. Click **OK** to save the connection configuration. + +
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Launch DataGrip and create a project to manage your connections. + +8. In the newly created project, click **+** in the upper-left corner of the **Database Explorer** panel, and select **Data Source** > **Other** > **TiDB**. + +9. Copy and paste the appropriate connection string into the **Data Source and Drivers** window in DataGrip. The mappings between DataGrip fields and {{{ .premium }}} connection string are as follows: + + | DataGrip field | {{{ .premium }}} connection string | + | -------------- | ------------------------------- | + | Host | `{host}` | + | Port | `{port}` | + | User | `{user}` | + | Password | `{password}` | + + - On the **SSH/SSL** tab, clear the **Use SSL** checkbox. + - If a **Download missing driver files** warning is displayed, click **Download** to acquire the driver files. + +10. Click **Test Connection** to validate the connection to the {{{ .premium }}} instance. + +11. Click **OK** to save the connection configuration. +
diff --git a/develop/dev-guide-gui-dbeaver.md b/develop/dev-guide-gui-dbeaver.md index f0bfe56720eda..d1d03d866c143 100644 --- a/develop/dev-guide-gui-dbeaver.md +++ b/develop/dev-guide-gui-dbeaver.md @@ -12,7 +12,7 @@ In this tutorial, you can learn how to connect to TiDB using DBeaver Community. > **Note:** > -> This tutorial is compatible with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial is compatible with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -86,6 +86,45 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 9. Click **Finish** to save the connection configuration. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Launch DBeaver and click **New Database Connection** in the upper-left corner. In the **Connect to a database** dialog, select **TiDB** from the list, and then click **Next**. + +8. Copy and paste the appropriate connection string into the DBeaver connection panel. The mappings between DBeaver fields and {{{ .premium }}} connection string are as follows: + + | DBeaver field | {{{ .premium }}} connection string | + |---------------| ------------------------------- | + | Server Host | `{host}` | + | Port | `{port}` | + | Username | `{user}` | + | Password | `{password}` | + + Keep the SSL settings disabled. + +9. Click **Test Connection** to validate the connection to the {{{ .premium }}} instance. + +10. Click **Finish** to save the connection configuration. +
diff --git a/develop/dev-guide-gui-mysql-workbench.md b/develop/dev-guide-gui-mysql-workbench.md index ea93a8f5d0116..283d4b59560f0 100644 --- a/develop/dev-guide-gui-mysql-workbench.md +++ b/develop/dev-guide-gui-mysql-workbench.md @@ -17,7 +17,7 @@ In this tutorial, you can learn how to connect to TiDB using MySQL Workbench. > **Note:** > -> This tutorial is compatible with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial is compatible with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -77,6 +77,42 @@ Connect to TiDB depending on the TiDB deployment option you have selected. 8. If the connection test is successful, you can see the **Successfully made the MySQL connection** message. Click **OK** to save the connection configuration. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Launch MySQL Workbench and click **+** near the **MySQL Connections** title. + +8. In the **Setup New Connection** dialog, configure the following connection parameters: + + - **Connection Name**: give this connection a meaningful name. + - **Hostname**: enter the `HOST` parameter from the TiDB Cloud connection dialog. + - **Port**: enter the `PORT` parameter from the TiDB Cloud connection dialog. + - **Username**: enter the `USERNAME` parameter from the TiDB Cloud connection dialog. + - **Password**: click **Store in Keychain ...** or **Store in Vault**, enter the password of the {{{ .premium }}} instance, and then click **OK** to store the password. + +9. Click **Test Connection** to validate the connection to the {{{ .premium }}} instance. + +10. If the connection test is successful, you can see the **Successfully made the MySQL connection** message. Click **OK** to save the connection configuration. +
diff --git a/develop/dev-guide-gui-navicat.md b/develop/dev-guide-gui-navicat.md index 20701071e3ac1..5444e3d8f7e52 100644 --- a/develop/dev-guide-gui-navicat.md +++ b/develop/dev-guide-gui-navicat.md @@ -12,7 +12,7 @@ In this tutorial, you can learn how to connect to TiDB using Navicat. > **Note:** > -> This tutorial is compatible with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial is compatible with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -73,6 +73,44 @@ Connect to TiDB depending on the TiDB deployment option you have selected. 9. If the connection test is successful, you can see the **Connection Successful** message. Click **OK** to finish the connection configuration. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Launch Navicat Premium, click **Connection** in the upper-left corner, select **PingCAP** from the **Vendor Filter** list, and double-click **TiDB** in the right panel. + +8. 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 {{{ .premium }}} instance. + +9. Click the **SSL** tab and clear the **Use SSL** checkbox. + +10. Click **Test Connection** to validate the connection to the {{{ .premium }}} instance. + +11. If the connection test is successful, you can see the **Connection Successful** message. Click **OK** to finish the connection configuration. +
diff --git a/develop/dev-guide-gui-vscode-sqltools.md b/develop/dev-guide-gui-vscode-sqltools.md index 0e1a459fa770a..f55aacc7606d1 100644 --- a/develop/dev-guide-gui-vscode-sqltools.md +++ b/develop/dev-guide-gui-vscode-sqltools.md @@ -12,7 +12,7 @@ In this tutorial, you can learn how to connect to TiDB using Visual Studio Code. > **Note:** > -> - This tutorial is compatible with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> - This tutorial is compatible with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. > - This tutorial also works with Visual Studio Code Remote Development environments, such as [GitHub Codespaces](https://github.com/features/codespaces), [Visual Studio Code Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers), and [Visual Studio Code WSL](https://code.visualstudio.com/docs/remote/wsl). ## Prerequisites @@ -93,6 +93,49 @@ Connect to TiDB depending on the TiDB deployment option you have selected. 8. If the connection test is successful, you can see the **Successfully connected!** message. Click **SAVE CONNECTION** to save the connection configuration. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Launch VS Code and select the **SQLTools** extension on the navigation pane. Under the **CONNECTIONS** section, click **Add New Connection** and select **TiDB** as the database driver. + +8. In the setting pane, configure the following connection parameters: + + - **Connect using**: select **Server and Port**. + - **Server Address**: enter the `host` parameter from the TiDB Cloud connection dialog. + - **Port**: enter the `port` parameter from the TiDB Cloud connection dialog. + - **Database**: enter the database that you want to connect to. + - **Username**: enter the `user` parameter from the TiDB Cloud connection dialog. + - **Password mode**: select **SQLTools Driver Credentials**. + - In the **MySQL driver specific options** area, configure the following parameters: + + - **Authentication Protocol**: select **default**. + - **SSL**: select **Disabled**. + +9. Click **TEST CONNECTION** to validate the connection to the {{{ .premium }}} instance. + +10. In the **SQLTools Driver Credentials** dialog, enter the password. + +11. If the connection test is successful, click **SAVE CONNECTION** to save the connection configuration. +
diff --git a/develop/dev-guide-sample-application-aws-lambda.md b/develop/dev-guide-sample-application-aws-lambda.md index a7652332d4138..1ec0faa7df8b8 100644 --- a/develop/dev-guide-sample-application-aws-lambda.md +++ b/develop/dev-guide-sample-application-aws-lambda.md @@ -17,7 +17,7 @@ In this tutorial, you can learn how to use TiDB and mysql2 in AWS Lambda Functio > **Note** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, and TiDB Self-Managed. ## Prerequisites @@ -99,7 +99,47 @@ Connect to TiDB depending on the TiDB deployment option you've selected. "TIDB_HOST": "{gateway-region}.aws.tidbcloud.com", "TIDB_PORT": "4000", "TIDB_USER": "{prefix}.root", - "TIDB_PASSWORD": "{password}" + "TIDB_PASSWORD": "{password}", + "TIDB_ENABLE_SSL": "true" + } + } + ``` + + Replace the placeholders in `{}` with the values obtained in the connection dialog. + +
+ +
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Copy and paste the corresponding connection string into `env.json`. The following is an example: + + ```json + { + "Parameters": { + "TIDB_HOST": "{host}", + "TIDB_PORT": "4000", + "TIDB_USER": "root", + "TIDB_PASSWORD": "{password}", + "TIDB_ENABLE_SSL": "false" } } ``` @@ -118,7 +158,8 @@ Copy and paste the corresponding connection string into `env.json`. The followin "TIDB_HOST": "{tidb_server_host}", "TIDB_PORT": "4000", "TIDB_USER": "root", - "TIDB_PASSWORD": "{password}" + "TIDB_PASSWORD": "{password}", + "TIDB_ENABLE_SSL": "false" } } ``` @@ -273,10 +314,10 @@ function connect() { user: process.env.TIDB_USER, // TiDB user, for example: {prefix}.root password: process.env.TIDB_PASSWORD, // TiDB password database: process.env.TIDB_DATABASE || 'test', // TiDB database name, default: test - ssl: { + ssl: process.env.TIDB_ENABLE_SSL === 'true' ? { minVersion: 'TLSv1.2', rejectUnauthorized: true, - }, + } : null, connectionLimit: 1, // Setting connectionLimit to "1" in a serverless function environment optimizes resource usage, reduces costs, ensures connection stability, and enables seamless scalability. maxIdle: 1, // max idle connections, the default value is the same as `connectionLimit` enableKeepAlive: true, diff --git a/develop/dev-guide-sample-application-golang-gorm.md b/develop/dev-guide-sample-application-golang-gorm.md index db36328af1fa7..ddc20d200a293 100644 --- a/develop/dev-guide-sample-application-golang-gorm.md +++ b/develop/dev-guide-sample-application-golang-gorm.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and GORM to accomplish the follo > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -95,6 +95,49 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Copy and paste the corresponding connection string into the `.env` file. The example result is as follows: + + ```dotenv + TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + TIDB_PORT='4000' + TIDB_USER='{user}' # e.g. root + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + USE_SSL='false' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-golang-sql-driver.md b/develop/dev-guide-sample-application-golang-sql-driver.md index fe5b55ef56fb2..fb1701fecb7ba 100644 --- a/develop/dev-guide-sample-application-golang-sql-driver.md +++ b/develop/dev-guide-sample-application-golang-sql-driver.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and Go-MySQL-Driver to accomplis > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -95,6 +95,49 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Copy and paste the corresponding connection string into the `.env` file. The example result is as follows: + + ```dotenv + TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + TIDB_PORT='4000' + TIDB_USER='{user}' # e.g. root + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + USE_SSL='false' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-java-hibernate.md b/develop/dev-guide-sample-application-java-hibernate.md index d92dbc46b1e45..c0c3ee048a4d1 100644 --- a/develop/dev-guide-sample-application-java-hibernate.md +++ b/develop/dev-guide-sample-application-java-hibernate.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and Hibernate to accomplish the > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -96,6 +96,49 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `env.sh` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `env.sh.example` and rename it to `env.sh`: + + ```shell + cp env.sh.example env.sh + ``` + +8. Copy and paste the corresponding connection string into the `env.sh` file. The example result is as follows: + + ```shell + export TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + export TIDB_PORT='4000' + export TIDB_USER='{user}' # e.g. root + export TIDB_PASSWORD='{password}' + export TIDB_DB_NAME='test' + export USE_SSL='false' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `env.sh` file. +
diff --git a/develop/dev-guide-sample-application-java-jdbc.md b/develop/dev-guide-sample-application-java-jdbc.md index fd29e4c7b50fc..59a9802a2576c 100644 --- a/develop/dev-guide-sample-application-java-jdbc.md +++ b/develop/dev-guide-sample-application-java-jdbc.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and JDBC to accomplish the follo > **Note:** > -> - This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> - This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. > - Starting from TiDB v7.4, if `connectionCollation` is not configured, and `characterEncoding` is either not configured or set to `UTF-8` in the JDBC URL, the collation used in a JDBC connection depends on the JDBC driver version. For more information, see [Collation used in JDBC connections](/faq/sql-faq.md#collation-used-in-jdbc-connections). ## Prerequisites @@ -98,6 +98,51 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `env.sh` file.
+ +
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `env.sh.example` and rename it to `env.sh`: + + ```shell + cp env.sh.example env.sh + ``` + +8. Copy and paste the corresponding connection string into the `env.sh` file. The example result is as follows: + + ```shell + export TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + export TIDB_PORT='4000' + export TIDB_USER='{user}' # e.g. root + export TIDB_PASSWORD='{password}' + export TIDB_DB_NAME='test' + export USE_SSL='false' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `env.sh` file. + +
+
1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target TiDB Cloud Dedicated cluster to go to its overview page. diff --git a/develop/dev-guide-sample-application-java-mybatis.md b/develop/dev-guide-sample-application-java-mybatis.md index b4c5d4d0f02b0..07014801af272 100644 --- a/develop/dev-guide-sample-application-java-mybatis.md +++ b/develop/dev-guide-sample-application-java-mybatis.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and MyBatis to accomplish the fo > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -96,6 +96,49 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `env.sh` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `env.sh.example` and rename it to `env.sh`: + + ```shell + cp env.sh.example env.sh + ``` + +8. Copy and paste the corresponding connection string into the `env.sh` file. The example result is as follows: + + ```shell + export TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + export TIDB_PORT='4000' + export TIDB_USER='{user}' # e.g. root + export TIDB_PASSWORD='{password}' + export TIDB_DB_NAME='test' + export USE_SSL='false' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `env.sh` file. +
diff --git a/develop/dev-guide-sample-application-java-spring-boot.md b/develop/dev-guide-sample-application-java-spring-boot.md index 66e969fe95b6d..290a5f86870b2 100644 --- a/develop/dev-guide-sample-application-java-spring-boot.md +++ b/develop/dev-guide-sample-application-java-spring-boot.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB along with [Spring Data JPA](htt > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -96,6 +96,49 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `env.sh` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `env.sh.example` and rename it to `env.sh`: + + ```shell + cp env.sh.example env.sh + ``` + +8. Copy and paste the corresponding connection string into the `env.sh` file. The example result is as follows: + + ```shell + export TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + export TIDB_PORT='4000' + export TIDB_USER='{user}' # e.g. root + export TIDB_PASSWORD='{password}' + export TIDB_DB_NAME='test' + export USE_SSL='false' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `env.sh` file. +
diff --git a/develop/dev-guide-sample-application-nextjs.md b/develop/dev-guide-sample-application-nextjs.md index 11281058e62cd..4a5a73abeeabc 100644 --- a/develop/dev-guide-sample-application-nextjs.md +++ b/develop/dev-guide-sample-application-nextjs.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and mysql2 in Next.js to accompl > **Note** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, and TiDB Self-Managed. ## Prerequisites @@ -105,6 +105,7 @@ Connect to TiDB depending on the TiDB deployment option you've selected. TIDB_USER='{prefix}.root' TIDB_PASSWORD='{password}' TIDB_DB_NAME='test' + TIDB_ENABLE_SSL='true' ``` Replace the placeholders in `{}` with the values obtained in the connection dialog. @@ -113,6 +114,56 @@ Connect to TiDB depending on the TiDB deployment option you've selected.
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```bash + # Linux + cp .env.example .env + ``` + + ```powershell + # Windows + Copy-Item ".env.example" -Destination ".env" + ``` + +8. Copy and paste the corresponding connection string into the `.env` file. The example result is as follows: + + ```bash + TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + TIDB_PORT='4000' + TIDB_USER='{user}' # e.g. root + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + TIDB_ENABLE_SSL='false' + ``` + + Replace the placeholders in `{}` with the values obtained in the connection dialog. + +9. Save the `.env` file. + +
+
1. Run the following command to copy `.env.example` and rename it to `.env`: @@ -135,6 +186,7 @@ Connect to TiDB depending on the TiDB deployment option you've selected. TIDB_USER='root' TIDB_PASSWORD='{password}' TIDB_DB_NAME='test' + TIDB_ENABLE_SSL='false' ``` Replace the placeholders in `{}` with the values obtained in the **Connect** window. If you are running TiDB locally, the default host address is `127.0.0.1`, and the password is empty. @@ -192,10 +244,10 @@ export function connect() { user: process.env.TIDB_USER, // TiDB user, for example: {prefix}.root password: process.env.TIDB_PASSWORD, // The password of TiDB user. database: process.env.TIDB_DATABASE || 'test', // TiDB database name, default: test - ssl: { + ssl: process.env.TIDB_ENABLE_SSL === 'true' ? { minVersion: 'TLSv1.2', rejectUnauthorized: true, - }, + } : null, connectionLimit: 1, // Setting connectionLimit to "1" in a serverless function environment optimizes resource usage, reduces costs, ensures connection stability, and enables seamless scalability. maxIdle: 1, // max idle connections, the default value is the same as `connectionLimit` enableKeepAlive: true, diff --git a/develop/dev-guide-sample-application-nodejs-mysql2.md b/develop/dev-guide-sample-application-nodejs-mysql2.md index a3bec1e6f3f46..533c01de3cfd9 100644 --- a/develop/dev-guide-sample-application-nodejs-mysql2.md +++ b/develop/dev-guide-sample-application-nodejs-mysql2.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and node-mysql2 to accomplish th > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -106,6 +106,47 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `{}` with connection parameters in the connection dialog: + + ```dotenv + TIDB_HOST={host} + TIDB_PORT=4000 + TIDB_USER={user} + TIDB_PASSWORD={password} + TIDB_DATABASE=test + TIDB_ENABLE_SSL=false + ``` + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-nodejs-mysqljs.md b/develop/dev-guide-sample-application-nodejs-mysqljs.md index 804e5b60a8995..a077508d606d4 100644 --- a/develop/dev-guide-sample-application-nodejs-mysqljs.md +++ b/develop/dev-guide-sample-application-nodejs-mysqljs.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and mysql.js driver to accomplis > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -106,6 +106,47 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `{}` with connection parameters in the connection dialog: + + ```dotenv + TIDB_HOST={host} + TIDB_PORT=4000 + TIDB_USER={user} + TIDB_PASSWORD={password} + TIDB_DATABASE=test + TIDB_ENABLE_SSL=false + ``` + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-nodejs-prisma.md b/develop/dev-guide-sample-application-nodejs-prisma.md index 5ffcdd9af295f..7230423c24386 100644 --- a/develop/dev-guide-sample-application-nodejs-prisma.md +++ b/develop/dev-guide-sample-application-nodejs-prisma.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and Prisma to accomplish the fol > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -109,6 +109,51 @@ Connect to TiDB depending on the TiDB deployment option you've selected. } ``` +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Edit the `.env` file, set up the environment variable `DATABASE_URL` as follows, and replace the corresponding placeholders `{}` with connection parameters in the connection dialog: + + ```dotenv + DATABASE_URL='mysql://{user}:{password}@{host}:4000/test' + ``` + +9. Save the `.env` file. + +10. In the `prisma/schema.prisma`, set up `mysql` as the connection provider and `env("DATABASE_URL")` as the connection URL: + + ```prisma + datasource db { + provider = "mysql" + url = env("DATABASE_URL") + } + ``` +
diff --git a/develop/dev-guide-sample-application-nodejs-sequelize.md b/develop/dev-guide-sample-application-nodejs-sequelize.md index e2bff8202e02f..57abaffc61460 100644 --- a/develop/dev-guide-sample-application-nodejs-sequelize.md +++ b/develop/dev-guide-sample-application-nodejs-sequelize.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and Sequelize to accomplish the > **Note** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -106,6 +106,48 @@ Connect to TiDB depending on the TiDB deployment option you've selected.
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `{}` with connection parameters in the connection dialog: + + ```dotenv + TIDB_HOST='{host}' + TIDB_PORT='4000' + TIDB_USER='{user}' + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + TIDB_ENABLE_SSL='false' + ``` + +9. Save the `.env` file. + +
+
1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target TiDB Cloud Dedicated cluster to go to its overview page. diff --git a/develop/dev-guide-sample-application-nodejs-typeorm.md b/develop/dev-guide-sample-application-nodejs-typeorm.md index f030081a9f546..d8d9264408370 100644 --- a/develop/dev-guide-sample-application-nodejs-typeorm.md +++ b/develop/dev-guide-sample-application-nodejs-typeorm.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and TypeORM to accomplish the fo > **Note** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -114,6 +114,47 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `{}` with connection parameters in the connection dialog: + + ```dotenv + TIDB_HOST={host} + TIDB_PORT=4000 + TIDB_USER={user} + TIDB_PASSWORD={password} + TIDB_DATABASE=test + TIDB_ENABLE_SSL=false + ``` + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-python-django.md b/develop/dev-guide-sample-application-python-django.md index 8b2a9859d0f53..b995e0a42d6b1 100644 --- a/develop/dev-guide-sample-application-python-django.md +++ b/develop/dev-guide-sample-application-python-django.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and Django to accomplish the fol > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -113,6 +113,48 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Copy and paste the corresponding connection string into the `.env` file. The example result is as follows: + + ```dotenv + TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + TIDB_PORT='4000' + TIDB_USER='{user}' # e.g. root + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-python-mysql-connector.md b/develop/dev-guide-sample-application-python-mysql-connector.md index 3e80a5dfdef9c..875715956b38e 100644 --- a/develop/dev-guide-sample-application-python-mysql-connector.md +++ b/develop/dev-guide-sample-application-python-mysql-connector.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and MySQL Connector/Python to ac > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -101,6 +101,48 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Copy and paste the corresponding connection string into the `.env` file. The example result is as follows: + + ```dotenv + TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + TIDB_PORT='4000' + TIDB_USER='{user}' # e.g. root + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-python-mysqlclient.md b/develop/dev-guide-sample-application-python-mysqlclient.md index 5b838effdf0c7..9fc0f575d3577 100644 --- a/develop/dev-guide-sample-application-python-mysqlclient.md +++ b/develop/dev-guide-sample-application-python-mysqlclient.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and mysqlclient to accomplish th > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -105,6 +105,49 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Copy and paste the corresponding connection string into the `.env` file. The example result is as follows: + + ```dotenv + TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + TIDB_PORT='4000' + TIDB_USER='{user}' # e.g. root + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + CA_PATH='' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-python-peewee.md b/develop/dev-guide-sample-application-python-peewee.md index 9980a0d889bee..d855c79c2feaa 100644 --- a/develop/dev-guide-sample-application-python-peewee.md +++ b/develop/dev-guide-sample-application-python-peewee.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and peewee to accomplish the fol > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -105,6 +105,48 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Copy and paste the corresponding connection string into the `.env` file. The example result is as follows: + + ```dotenv + TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + TIDB_PORT='4000' + TIDB_USER='{user}' # e.g. root + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-python-pymysql.md b/develop/dev-guide-sample-application-python-pymysql.md index 557573019af08..95b683c9204ac 100644 --- a/develop/dev-guide-sample-application-python-pymysql.md +++ b/develop/dev-guide-sample-application-python-pymysql.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and PyMySQL to accomplish the fo > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -101,6 +101,48 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Copy and paste the corresponding connection string into the `.env` file. The example result is as follows: + + ```dotenv + TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + TIDB_PORT='4000' + TIDB_USER='{user}' # e.g. root + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-python-sqlalchemy.md b/develop/dev-guide-sample-application-python-sqlalchemy.md index 38c219e02ff98..c39c9166c9444 100644 --- a/develop/dev-guide-sample-application-python-sqlalchemy.md +++ b/develop/dev-guide-sample-application-python-sqlalchemy.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and SQLAlchemy to accomplish the > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -111,6 +111,48 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Copy and paste the corresponding connection string into the `.env` file. The example result is as follows: + + ```dotenv + TIDB_HOST='{host}' # e.g. tidb.xxxx.clusters.tidb-cloud.com + TIDB_PORT='4000' + TIDB_USER='{user}' # e.g. root + TIDB_PASSWORD='{password}' + TIDB_DB_NAME='test' + ``` + + Be sure to replace the placeholders `{}` with the connection parameters obtained from the connection dialog. + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-ruby-mysql2.md b/develop/dev-guide-sample-application-ruby-mysql2.md index b4a9f0bbf31d9..a9192362b9826 100644 --- a/develop/dev-guide-sample-application-ruby-mysql2.md +++ b/develop/dev-guide-sample-application-ruby-mysql2.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and mysql2 to accomplish the fol > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -107,6 +107,47 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `{}` with connection parameters in the connection dialog: + + ```dotenv + DATABASE_HOST={host} + DATABASE_PORT=4000 + DATABASE_USER={user} + DATABASE_PASSWORD={password} + DATABASE_NAME=test + DATABASE_ENABLE_SSL=false + ``` + +9. Save the `.env` file. +
diff --git a/develop/dev-guide-sample-application-ruby-rails.md b/develop/dev-guide-sample-application-ruby-rails.md index 4ea0afcc3e7c9..0b5e7b6353515 100644 --- a/develop/dev-guide-sample-application-ruby-rails.md +++ b/develop/dev-guide-sample-application-ruby-rails.md @@ -16,7 +16,7 @@ In this tutorial, you can learn how to use TiDB and Rails to accomplish the foll > **Note:** > -> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. +> This tutorial works with {{{ .starter }}}, {{{ .essential }}}, {{{ .premium }}}, TiDB Cloud Dedicated, and TiDB Self-Managed. ## Prerequisites @@ -97,6 +97,42 @@ Connect to TiDB depending on the TiDB deployment option you've selected. 7. Save the `.env` file. +
+
+ +1. Navigate to the [**My TiDB**](https://tidbcloud.com/tidbs) page, and then click the name of your target {{{ .premium }}} instance to go to its overview page. + +2. In the left navigation pane, click **Settings** > **Networking**. + +3. On the **Networking** page, click **Enable** for **Public Endpoint**, and then click **Add IP Address**. + + Ensure that your client IP address is added to the access list. + +4. In the left navigation pane, click **Overview** to return to the instance overview page. + +5. Click **Connect** in the upper-right corner. A connection dialog is displayed. + +6. In the connection dialog, select **Public** from the **Connection Type** drop-down list. + + - If a message indicates that the public endpoint is still being enabled, wait until the process completes. + - If you have not set a password yet, click **Set Root Password** in the dialog. + - If you need to verify the server certificate or if the connection fails and requires a CA certificate, click **CA cert** to download it. + - In addition to the **Public** connection type, {{{ .premium }}} supports **Private Endpoint** connections. For more information, see [Connect to {{{ .premium }}} via AWS PrivateLink](/tidb-cloud/premium/connect-to-premium-via-aws-private-endpoint.md). + +7. Run the following command to copy `.env.example` and rename it to `.env`: + + ```shell + cp .env.example .env + ``` + +8. Edit the `.env` file, set up the `DATABASE_URL` environment variable as follows, and replace the corresponding placeholders `{}` with connection parameters in the connection dialog: + + ```dotenv + DATABASE_URL='mysql2://{user}:{password}@{host}:{port}/{database_name}' + ``` + +9. Save the `.env` file. +