Skip to content

ci: ZH translation 1755097660 #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: i18n-zh-release-8.5
Choose a base branch
from
Open
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
95 changes: 47 additions & 48 deletions develop/dev-guide-build-cluster-in-cloud.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
---
title: Build a {{{ .starter }}} Cluster
summary: Learn how to build a {{{ .starter }}} cluster in TiDB Cloud and connect to it.
title: 构建 TiDB Cloud Starter 集群
summary: 了解如何在 TiDB Cloud 中构建 TiDB Cloud Starter 集群并连接到该集群。
---

<!-- markdownlint-disable MD029 -->

# Build a {{{ .starter }}} Cluster
# 构建 TiDB Cloud Starter 集群

<CustomContent platform="tidb">

This document walks you through the quickest way to get started with TiDB. You will use [TiDB Cloud](https://www.pingcap.com/tidb-cloud) to create a {{{ .starter }}} cluster, connect to it, and run a sample application on it.
本文档将带你快速上手 TiDB。你将使用 [TiDB Cloud](https://www.pingcap.com/tidb-cloud) 创建一个 TiDB Cloud Starter(原 Serverless)集群,连接到该集群,并在其上运行一个示例应用程序。

If you need to run TiDB on your local machine, see [Starting TiDB Locally](/quick-start-with-tidb.md).
如果你需要在本地机器上运行 TiDB,请参见 [本地启动 TiDB](/quick-start-with-tidb.md)

</CustomContent>

<CustomContent platform="tidb-cloud">

This document walks you through the quickest way to get started with TiDB Cloud. You will create a TiDB cluster, connect to it, and run a sample application on it.
本文档将带你快速上手 TiDB Cloud。你将创建一个 TiDB 集群,连接到该集群,并在其上运行一个示例应用程序。

</CustomContent>

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

1. If you do not have a TiDB Cloud account, click [here](https://tidbcloud.com/free-trial) to sign up for an account.
1. 如果你还没有 TiDB Cloud 账号,请点击[这里](https://tidbcloud.com/free-trial)注册账号。

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

3. On the [**Clusters**](https://tidbcloud.com/console/clusters) page, click **Create Cluster**.
3. [**Clusters**](https://tidbcloud.com/console/clusters) 页面,点击 **Create Cluster**

4. On the **Create Cluster** page, **Serverless** is selected by default. Update the default cluster name if necessary, and then select the region where you want to create your cluster.
4. **Create Cluster** 页面,**Starter** 默认已选中。如有需要可修改默认集群名称,然后选择你希望创建集群的区域。

5. Click **Create** to create a {{{ .starter }}} cluster.
5. 点击 **Create** 创建 TiDB Cloud Starter 集群。

Your TiDB Cloud cluster will be created in approximately 30 seconds.
你的 TiDB Cloud 集群将在大约 30 秒内创建完成。

6. After your TiDB Cloud cluster is created, click your cluster name to go to the cluster overview page, and then click **Connect** in the upper-right corner. A connection dialog box is displayed.
6. 集群创建完成后,点击你的集群名称进入集群概览页面,然后点击右上角的 **Connect**。此时会弹出连接对话框。

7. In the dialog, select your preferred connection method and operating system to get the corresponding connection string. This document uses MySQL client as an example.
7. 在对话框中,选择你偏好的连接方式和操作系统,以获取对应的连接字符串。本文档以 MySQL 客户端为例。

8. Click **Generate Password** to generate a random password. The generated password will not show again, so save your password in a secure location. If you do not set a root password, you cannot connect to the cluster.
8. 点击 **Generate Password** 生成一个随机密码。生成的密码只会显示一次,请妥善保存。如果你没有设置 root 密码,将无法连接到集群。

<CustomContent platform="tidb">

> **Note:**
> **注意:**
>
> For [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-cloud-serverless) clusters, when you connect to your cluster, you must include the prefix for your cluster in the user name and wrap the name with quotation marks. For more information, see [User name prefix](https://docs.pingcap.com/tidbcloud/select-cluster-tier#user-name-prefix).
> 对于 [TiDB Cloud Starter](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-cloud-serverless) 集群,连接集群时,必须在用户名中包含集群的前缀,并用引号包裹用户名。详细信息请参见 [用户名前缀](https://docs.pingcap.com/tidbcloud/select-cluster-tier#user-name-prefix)

</CustomContent>

<CustomContent platform="tidb-cloud">

> **Note:**
> **注意:**
>
> For [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-cloud-serverless) clusters, when you connect to your cluster, you must include the prefix for your cluster in the user name and wrap the name with quotation marks. For more information, see [User name prefix](/tidb-cloud/select-cluster-tier.md#user-name-prefix).
> 对于 [TiDB Cloud Starter](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-cloud-serverless) 集群,连接集群时,必须在用户名中包含集群的前缀,并用引号包裹用户名。详细信息请参见 [用户名前缀](/tidb-cloud/select-cluster-tier.md#user-name-prefix)

</CustomContent>

## Step 2. Connect to a cluster
## 第 2 步. 连接到集群

1. If the MySQL client is not installed, select your operating system and follow the steps below to install it.
1. 如果未安装 MySQL 客户端,请选择你的操作系统并按照以下步骤安装。

<SimpleTab>

<div label="macOS">

For macOS, install [Homebrew](https://brew.sh/index) if you do not have it, and then run the following command to install the MySQL client:
对于 macOS,如果你还没有安装 [Homebrew](https://brew.sh/index),请先安装,然后运行以下命令安装 MySQL 客户端:

```shell
brew install mysql-client
```

The output is as follows:
输出如下:

```
mysql-client is keg-only, which means it was not symlinked into /opt/homebrew,
Expand All @@ -85,20 +85,20 @@ For compilers to find mysql-client you may need to set:
export CPPFLAGS="-I/opt/homebrew/opt/mysql-client/include"
```

To add the MySQL client to your PATH, locate the following command in the above output (if your output is inconsistent with the above output in the document, use the corresponding command in your output instead) and run it:
要将 MySQL 客户端添加到 PATH,请在上述输出中找到如下命令(如果你的输出与本文档不一致,请使用你输出中的对应命令)并运行:

```shell
echo 'export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
```

Then, declare the global environment variable by the `source` command and verify that the MySQL client is installed successfully:
然后,通过 `source` 命令声明全局环境变量,并验证 MySQL 客户端是否安装成功:

```shell
source ~/.zshrc
mysql --version
```

An example of the expected output:
预期输出示例:

```
mysql Ver 8.0.28 for macos12.0 on arm64 (Homebrew)
Expand All @@ -108,19 +108,19 @@ mysql Ver 8.0.28 for macos12.0 on arm64 (Homebrew)

<div label="Linux">

For Linux, the following takes Ubuntu as an example:
Ubuntu 为例:

```shell
apt-get install mysql-client
```

Then, verify that the MySQL client is installed successfully:
然后,验证 MySQL 客户端是否安装成功:

```shell
mysql --version
```

An example of the expected output:
预期输出示例:

```
mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1
Expand All @@ -130,43 +130,42 @@ mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1

</SimpleTab>

2. Run the connection string obtained in [Step 1](#step-1-create-a-tidb-cloud-cluster).

{{< copyable "shell-regular" >}}
2. 运行在[第 1 步](#step-1-create-a-tidb-cloud-cluster)中获取的连接字符串。


```shell
mysql --connect-timeout 15 -u '<prefix>.root' -h <host> -P 4000 -D test --ssl-mode=VERIFY_IDENTITY --ssl-ca=/etc/ssl/cert.pem -p
```

<CustomContent platform="tidb">

> **Note:**
> **注意:**
>
> - When you connect to a {{{ .starter }}} cluster, you must [use the TLS connection](https://docs.pingcap.com/tidbcloud/secure-connections-to-serverless-clusters).
> - If you encounter problems when connecting to a {{{ .starter }}} cluster, you can read [Secure Connections to {{{ .starter }}} Clusters](https://docs.pingcap.com/tidbcloud/secure-connections-to-serverless-clusters) for more information.
> - 连接 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">

> **Note:**
> **注意:**
>
> - When you connect to a {{{ .starter }}} cluster, you must [use the TLS connection](/tidb-cloud/secure-connections-to-serverless-clusters.md).
> - If you encounter problems when connecting to a {{{ .starter }}} cluster, you can read [Secure Connections to {{{ .starter }}} Clusters](/tidb-cloud/secure-connections-to-serverless-clusters.md) for more information.
> - 连接 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. Fill in the password to sign in.
3. 输入密码进行登录。

## Step 3. Execute a SQL statement
## 第 3 步. 执行 SQL 语句

Let's try to execute your first SQL statement on TiDB Cloud.
让我们尝试在 TiDB Cloud 上执行你的第一条 SQL 语句。

```sql
SELECT 'Hello TiDB Cloud!';
```

Expected output:
预期输出:

```sql
+-------------------+
Expand All @@ -176,18 +175,18 @@ Expected output:
+-------------------+
```

If your actual output is similar to the expected output, congratulations, you have successfully executed a SQL statement on TiDB Cloud.
如果你的实际输出与预期输出类似,恭喜你,已经在 TiDB Cloud 上成功执行了一条 SQL 语句。

## Need help?
## 需要帮助?

<CustomContent platform="tidb">

Ask the community on [Discord](https://discord.gg/DQZ2dy3cuc?utm_source=doc) or [Slack](https://slack.tidb.io/invite?team=tidb-community&channel=everyone&ref=pingcap-docs), or [submit a support ticket](/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">

Ask the community on [Discord](https://discord.gg/DQZ2dy3cuc?utm_source=doc) or [Slack](https://slack.tidb.io/invite?team=tidb-community&channel=everyone&ref=pingcap-docs), or [submit a support ticket](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>
</CustomContent>
Loading