Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 60 additions & 61 deletions develop/dev-guide-aws-appflow-integration.md

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions develop/dev-guide-build-cluster-in-cloud.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
---
title: 搭建一个 {{{ .starter }}} 集群
summary: 学习如何在 TiDB Cloud 中搭建一个 {{{ .starter }}} 集群并连接到它。
title: 构建 TiDB Cloud Starter 集群
summary: 了解如何在 TiDB Cloud 中构建 TiDB Cloud Starter 集群并连接到它。
---

<!-- markdownlint-disable MD029 -->

# 搭建一个 {{{ .starter }}} 集群
# 构建 TiDB Cloud Starter 集群

<CustomContent platform="tidb">

本文档将带你快速上手 TiDB。你将使用 [TiDB Cloud](https://www.pingcap.com/tidb-cloud) 创建一个 {{{ .starter }}}(原 Serverless)集群,连接到该集群,并在其上运行一个示例应用程序。
本文档将带你快速上手 TiDB。你将使用 [TiDB Cloud](https://www.pingcap.com/tidb-cloud) 创建一个 TiDB Cloud Starter 集群,连接到它,并在其上运行一个示例应用程序。

如果你需要在本地机器上运行 TiDB,请参见 [本地启动 TiDB](/quick-start-with-tidb.md)。

</CustomContent>

<CustomContent platform="tidb-cloud">

本文档将带你快速上手 TiDB Cloud。你将创建一个 TiDB 集群,连接到该集群,并在其上运行一个示例应用程序。
本文档将带你快速上手 TiDB Cloud。你将创建一个 TiDB 集群,连接到它,并在其上运行一个示例应用程序。

</CustomContent>

## 第 1 步:创建一个 {{{ .starter }}} 集群 {#step-1-create-a-tidb-cloud-cluster}
## 第 1 步. 创建 TiDB Cloud Starter 集群 {#step-1-create-a-tidb-cloud-cluster}

1. 如果你还没有 TiDB Cloud 账号,请点击[这里](https://tidbcloud.com/free-trial)注册账号。
1. 如果你还没有 TiDB Cloud 账号,请点击 [这里](https://tidbcloud.com/free-trial) 注册账号。

2. [登录](https://tidbcloud.com/)你的 TiDB Cloud 账号。
2. [登录](https://tidbcloud.com/) 你的 TiDB Cloud 账号。

3. 在 [**Clusters**](https://tidbcloud.com/console/clusters) 页面,点击 **Create Cluster**。

4. 在 **Create Cluster** 页面,**Starter** 默认已选中。如有需要,可修改默认集群名称,并选择你希望创建集群的区域
4. 在 **Create Cluster** 页面,**Starter** 默认已选中。如有需要可修改默认集群名称,然后选择你希望创建集群的区域

5. 点击 **Create** 创建一个 {{{ .starter }}} 集群。
5. 点击 **Create** 创建 TiDB Cloud Starter 集群。

你的 TiDB Cloud 集群将在大约 30 秒内创建完成。

Expand All @@ -45,27 +45,27 @@ summary: 学习如何在 TiDB Cloud 中搭建一个 {{{ .starter }}} 集群并

> **注意:**
>
> 对于 [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-cloud-serverless) 集群,连接集群时,必须在用户名中包含集群的前缀,并用引号包裹用户名。详细信息请参见 [用户名前缀](https://docs.pingcap.com/tidbcloud/select-cluster-tier#user-name-prefix)。
> 对于 [TiDB Cloud Starter](https://docs.pingcap.com/tidbcloud/select-cluster-tier#starter) 集群,连接集群时,必须在用户名中包含集群的前缀,并用引号包裹用户名。更多信息请参见 [用户名前缀](https://docs.pingcap.com/tidbcloud/select-cluster-tier#user-name-prefix)。

</CustomContent>

<CustomContent platform="tidb-cloud">

> **注意:**
>
> 对于 [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-cloud-serverless) 集群,连接集群时,必须在用户名中包含集群的前缀,并用引号包裹用户名。详细信息请参见 [用户名前缀](/tidb-cloud/select-cluster-tier.md#user-name-prefix)。
> 对于 [TiDB Cloud Starter](https://docs.pingcap.com/tidbcloud/select-cluster-tier#starter) 集群,连接集群时,必须在用户名中包含集群的前缀,并用引号包裹用户名。更多信息请参见 [用户名前缀](/tidb-cloud/select-cluster-tier.md#user-name-prefix)。

</CustomContent>

## 第 2 步连接到集群
## 第 2 步. 连接到集群

1. 如果未安装 MySQL 客户端,请选择你的操作系统并按照以下步骤安装。

<SimpleTab>

<div label="macOS">

对于 macOS,如果尚未安装 [Homebrew](https://brew.sh/index),请先安装,然后运行以下命令安装 MySQL 客户端:
对于 macOS,如果你还没有安装 [Homebrew](https://brew.sh/index),请先安装,然后运行以下命令安装 MySQL 客户端:

```shell
brew install mysql-client
Expand All @@ -85,7 +85,7 @@ For compilers to find mysql-client you may need to set:
export CPPFLAGS="-I/opt/homebrew/opt/mysql-client/include"
```

要将 MySQL 客户端添加到 PATH,请在上述输出中找到以下命令(如果你的输出与本文档不一致,请使用你输出中的对应命令)并运行:
要将 MySQL 客户端添加到 PATH,请在上述输出中找到如下命令(如果你的输出与本文档不一致,请使用你输出中的对应命令)并运行:

```shell
echo 'export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
Expand Down Expand Up @@ -130,7 +130,7 @@ mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1

</SimpleTab>

2. 运行在[第 1 步](#step-1-create-a-tidb-cloud-cluster)中获取的连接字符串
2. 运行在 [第 1 步](#step-1-create-a-tidb-cloud-cluster) 获取的连接字符串


```shell
Expand All @@ -141,23 +141,23 @@ mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1

> **注意:**
>
> - 连接 {{{ .starter }}} 集群时,必须[使用 TLS 连接](https://docs.pingcap.com/tidbcloud/secure-connections-to-serverless-clusters)。
> - 如果在连接 {{{ .starter }}} 集群时遇到问题,可以参考 [安全连接到 {{{ .starter }}} 集群](https://docs.pingcap.com/tidbcloud/secure-connections-to-serverless-clusters) 获取更多信息。
> - 连接 TiDB Cloud Starter 集群时,必须 [使用 TLS 连接](https://docs.pingcap.com/tidbcloud/secure-connections-to-serverless-clusters)。
> - 如果在连接 TiDB Cloud Starter 集群时遇到问题,可以参考 [安全连接到 TiDB Cloud Starter 集群](https://docs.pingcap.com/tidbcloud/secure-connections-to-serverless-clusters) 获取更多信息。

</CustomContent>

<CustomContent platform="tidb-cloud">

> **注意:**
>
> - 连接 {{{ .starter }}} 集群时,必须[使用 TLS 连接](/tidb-cloud/secure-connections-to-serverless-clusters.md)。
> - 如果在连接 {{{ .starter }}} 集群时遇到问题,可以参考 [安全连接到 {{{ .starter }}} 集群](/tidb-cloud/secure-connections-to-serverless-clusters.md) 获取更多信息。
> - 连接 TiDB Cloud Starter 集群时,必须 [使用 TLS 连接](/tidb-cloud/secure-connections-to-serverless-clusters.md)。
> - 如果在连接 TiDB Cloud Starter 集群时遇到问题,可以参考 [安全连接到 TiDB Cloud Starter 集群](/tidb-cloud/secure-connections-to-serverless-clusters.md) 获取更多信息。

</CustomContent>

3. 输入密码以登录
3. 输入密码进行登录

## 第 3 步执行 SQL 语句
## 第 3 步. 执行 SQL 语句

让我们尝试在 TiDB Cloud 上执行你的第一条 SQL 语句。

Expand All @@ -181,12 +181,12 @@ SELECT 'Hello TiDB Cloud!';

<CustomContent platform="tidb">

可以在 [Discord](https://discord.gg/DQZ2dy3cuc?utm_source=doc) 或 [Slack](https://slack.tidb.io/invite?team=tidb-community&channel=everyone&ref=pingcap-docs) 社区提问,或[提交支持工单](/support.md)。
可以在 [Discord](https://discord.gg/DQZ2dy3cuc?utm_source=doc) 或 [Slack](https://slack.tidb.io/invite?team=tidb-community&channel=everyone&ref=pingcap-docs) 社区提问,或 [提交支持工单](/support.md)。

</CustomContent>

<CustomContent platform="tidb-cloud">

可以在 [Discord](https://discord.gg/DQZ2dy3cuc?utm_source=doc) 或 [Slack](https://slack.tidb.io/invite?team=tidb-community&channel=everyone&ref=pingcap-docs) 社区提问,或[提交支持工单](https://tidb.support.pingcap.com/)。
可以在 [Discord](https://discord.gg/DQZ2dy3cuc?utm_source=doc) 或 [Slack](https://slack.tidb.io/invite?team=tidb-community&channel=everyone&ref=pingcap-docs) 社区提问,或 [提交支持工单](https://tidb.support.pingcap.com/)。

</CustomContent>
20 changes: 10 additions & 10 deletions develop/dev-guide-sample-application-cs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ C#(发音为 “C-Sharp”)是 .NET 家族中的一种编程语言,由 Mic

- 下载 [.NET 9.0 SDK](https://dotnet.microsoft.com/en-us/download)。
- 本教程使用 `dotnet` 命令行工具。你也可以使用 Visual Studio Code IDE 来编写 C# 代码。
- 要完成本教程,你需要有一个 TiDB 实例的访问权限。你可以使用 TiDB Cloud 上的 [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier/#tidb-cloud-serverless) 或 [TiDB Cloud Dedicated](https://docs.pingcap.com/tidbcloud/select-cluster-tier/#tidb-cloud-dedicated) 集群,或者使用 `tiup playground` 启动的 TiDB 自建集群。
- 要完成本教程,你需要有一个 TiDB 实例的访问权限。你可以使用 TiDB Cloud 上的 [TiDB Cloud Starter](https://docs.pingcap.com/tidbcloud/select-cluster-tier#starter) 或 [TiDB Cloud Dedicated](https://docs.pingcap.com/tidbcloud/select-cluster-tier/#tidb-cloud-dedicated) 集群,或者使用 `tiup playground` 启动的 TiDB 自建集群。

## 步骤 1. 创建控制台项目
## 第 1 步:创建控制台项目

使用 `console` 模板创建一个新项目。这会生成一个名为 `tidb_cs` 的新目录。在运行以下命令前,请先切换到你希望创建该目录的位置,或者直接指定完整路径
使用 `console` 模板创建一个新项目。这会生成一个名为 `tidb_cs` 的新目录。在运行以下命令前,请先切换到你希望创建该目录的位置,或者指定完整路径

```
$ dotnet new console -o tidb_cs
Expand All @@ -28,7 +28,7 @@ Restoring /home/dvaneeden/tidb_cs/tidb_cs.csproj:
Restore succeeded.
```

## 步骤 2. 添加 MySql.Data 包
## 第 2 步:添加 MySql.Data 包

.NET 的包管理器叫做 NuGet。MySQL Connector/NET 的 NuGet 包名称为 [MySql.Data](https://www.nuget.org/packages/MySql.Data),它为 .NET 应用程序提供了 MySQL 协议的支持。如果你没有指定版本,NuGet 会安装最新的稳定版本(例如 9.3.0 版本)。

Expand Down Expand Up @@ -56,7 +56,7 @@ info : Writing assets file to disk. Path: /home/dvaneeden/tidb_cs/obj/project.as
log : Restored /home/dvaneeden/tidb_cs/tidb_cs.csproj (in 551 ms).
```

## 步骤 3. 更新代码
## 第 3 步:更新代码

将 `Program.cs` 中的 “Hello World” 示例替换为以下代码。

Expand Down Expand Up @@ -97,20 +97,20 @@ public class Tutorial1
}
```

这段代码会连接到指定 IP 和端口的 TiDB 实例。如果你使用 TiDB Cloud,请将连接字符串参数(如 hostname、port、user 和 password)替换为 [TiDB Cloud 控制台](https://tidbcloud.com/) 中提供的详细信息
这段代码会连接到指定 IP 和端口的 TiDB 实例。如果你使用 TiDB Cloud,请将连接字符串参数(如主机名、端口、用户和密码)替换为 [TiDB Cloud 控制台](https://tidbcloud.com/) 提供的详细信息

该代码会连接数据库,打印其版本信息,然后通过执行 [`TIDB_VERSION()`](/functions-and-operators/tidb-functions.md#tidb_version) SQL 查询获取更详细的版本信息,并最终输出该结果
该代码会连接数据库,打印其版本信息,然后使用 [`TIDB_VERSION()`](/functions-and-operators/tidb-functions.md#tidb_version) 执行 SQL 查询以获取更详细的版本信息,并最终打印该结果

## 步骤 4. 运行程序
## 第 4 步:运行程序

```
$ dotnet run
Connecting to TiDB...

Connected to: 8.0.11-TiDB-v{{{ .tidb-version }}}
Connected to: 8.0.11-TiDB-v8.5.3

Version details:
Release Version: v{{{ .tidb-version }}}
Release Version: v8.5.3
Edition: Community
Git Commit Hash: f43a13324440f92209e2a9f04c0bbe9cf763978d
Git Branch: HEAD
Expand Down
Loading