+
+
+1. Navigate to the [**Clusters**](https://tidbcloud.com/console/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`.
+ - **Connect With** is set to `General`.
+ - **Operating System** matches the operating system where you run the application.
+
+4. If you have not set a password yet, click **Create password** to generate a random password.
+
+5. Run the following command to copy `.env.example` and rename it to `.env`:
+
+ ```shell
+ cp .env.example .env
+ ```
+
+6. Edit the `.env` file, set up the environment variables as follows, replace the corresponding placeholders `{}` with connection parameters on the connection dialog:
+
+ ```dotenv
+ TIDB_HOST={host}
+ TIDB_PORT=4000
+ TIDB_USER={user}
+ TIDB_PASSWORD={password}
+ TIDB_DATABASE=test
+ TIDB_ENABLE_SSL=true
+ ```
+
+ > **Note**
+ >
+ > For TiDB Serverless, you **MUST** enable TLS connection via `TIDB_ENABLE_SSL` when using public endpoint.
+
+7. Save the `.env` file.
+
+
+
+
+1. Navigate to the [**Clusters**](https://tidbcloud.com/console/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** and then click **Download TiDB cluster CA** to download the CA certificate.
+
+ For more details about how to obtain the connection string, refer to [TiDB Dedicated standard connection](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection).
+
+4. Run the following command to copy `.env.example` and rename it to `.env`:
+
+ ```shell
+ cp .env.example .env
+ ```
+
+5. Edit the `.env` file, set up the environment variables as follows, replace the corresponding placeholders `{}` with connection parameters on the connection dialog:
+
+ ```dotenv
+ TIDB_HOST={host}
+ TIDB_PORT=4000
+ TIDB_USER={user}
+ TIDB_PASSWORD={password}
+ TIDB_DATABASE=test
+ TIDB_ENABLE_SSL=true
+ TIDB_CA_PATH={downloaded_ssl_ca_path}
+ ```
+
+ > **Note**
+ >
+ > For TiDB Dedicated, it is **RECOMMENDED** to enable TLS connection via `TIDB_ENABLE_SSL` when using public endpoint. When you set up `TIDB_ENABLE_SSL=true`, you **MUST** specify the path of the CA certificate downloaded from connection dialog via `TIDB_CA_PATH=/path/to/ca.pem`.
+
+6. Save the `.env` file.
+
+
+
+
+1. Run the following command to copy `.env.example` and rename it to `.env`:
+
+ ```shell
+ cp .env.example .env
+ ```
+
+2. Edit the `.env` file, set up the environment variables as follows, replace the corresponding placeholders `{}` with connection parameters of your TiDB cluster:
+
+ ```dotenv
+ TIDB_HOST={host}
+ TIDB_PORT=4000
+ TIDB_USER=root
+ TIDB_PASSWORD={password}
+ TIDB_DATABASE=test
+ ```
+
+ If you are running TiDB locally, the default host address is `127.0.0.1`, and the password is empty.
+
+3. Save the `.env` file.
+
+
+
+
+### Step 4: Initialize the database schema
+
+Run the following command to invoke TypeORM CLI to initialize the database with the SQL statements written in the migration files in the `src/migrations` folder:
+
+```shell
+npm run migration:run
+```
+
+