Skip to content
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

[Update] change mysql-client to mycli #9643

Closed
wants to merge 2 commits into from

Conversation

Icemap
Copy link
Member

@Icemap Icemap commented May 31, 2022

First-time contributors' checklist

What is changed, added or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions (in Chinese).

  • master (the latest development version)
  • v6.1 (TiDB 6.1 versions)
  • v6.0 (TiDB 6.0 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)
  • v4.0 (TiDB 4.0 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@Icemap Icemap added the area/develop This PR relates to the area of TiDB App development. label May 31, 2022
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot requested a review from TomShawn May 31, 2022 09:48
@ti-chi-bot ti-chi-bot added missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 31, 2022
@Oreoxmt Oreoxmt self-requested a review June 2, 2022 03:50
@Oreoxmt Oreoxmt added translation/doing This PR’s assignee is translating this PR. type/enhancement The issue or PR belongs to an enhancement. and removed missing-translation-status This PR does not have translation status info. labels Jun 2, 2022

以 CentOS 7 为例:
请参考 [mycli 安装页面](https://www.mycli.net/install),推荐使用其中的 **Python Package** 章节,即使用 pip 包管理器进行安装。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
请参考 [mycli 安装页面](https://www.mycli.net/install),推荐使用其中的 **Python Package** 章节,即使用 pip 包管理器进行安装。
请参考[安装 mycli](https://www.mycli.net/install),推荐参考其中的 **Python Package** 章节,即使用 `pip` 包管理器进行安装。

@@ -241,7 +241,7 @@ UPDATE `t` SET `a` = 11 WHERE `id` = 2;
UPDATE `t` SET `a` = 12 WHERE `id` = 3;
```

另外,因为一个[客户端 bug](https://bugs.mysql.com/bug.php?id=96623),批量更新时如果要配置 `rewriteBatchedStatements = true` 和 `useServerPrepStmts = true`,推荐同时配置 `allowMultiQueries = true` 参数来避免这个 bug。
另外,因为一个[MySQL JDBC bug](https://bugs.mysql.com/bug.php?id=96623),批量更新时如果要配置 `rewriteBatchedStatements = true` 和 `useServerPrepStmts = true`,推荐同时配置 `allowMultiQueries = true` 参数来避免这个 bug。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
另外,因为一个[MySQL JDBC bug](https://bugs.mysql.com/bug.php?id=96623),批量更新时如果要配置 `rewriteBatchedStatements = true``useServerPrepStmts = true`,推荐同时配置 `allowMultiQueries = true` 参数来避免这个 bug。
另外,因为一个 [MySQL JDBC bug](https://bugs.mysql.com/bug.php?id=96623),批量更新时如果要配置 `rewriteBatchedStatements = true``useServerPrepStmts = true`,推荐同时配置 `allowMultiQueries = true` 参数来避免这个 bug。

@@ -822,7 +822,7 @@ dsn := "root:123456@tcp(xxx.tidbcloud.com:4000)/test?charset=utf8mb4"

运行 `make all`,这是以下三个操作的组合:

- 创建表 (make mysql):`mysql --host 127.0.0.1 --port 4000 -u root<sql/dbinit.sql`
- 创建表 (make prepare):`mycli --host 127.0.0.1 --port 4000 -u root --no-warn < sql/dbinit.sql`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 创建表 (make prepare):`mycli --host 127.0.0.1 --port 4000 -u root --no-warn < sql/dbinit.sql`
- 创建表 (`make prepare`):`mycli --host 127.0.0.1 --port 4000 -u root --no-warn < sql/dbinit.sql`

@@ -822,7 +822,7 @@ dsn := "root:123456@tcp(xxx.tidbcloud.com:4000)/test?charset=utf8mb4"

运行 `make all`,这是以下三个操作的组合:

- 创建表 (make mysql):`mysql --host 127.0.0.1 --port 4000 -u root<sql/dbinit.sql`
- 创建表 (make prepare):`mycli --host 127.0.0.1 --port 4000 -u root --no-warn < sql/dbinit.sql`
- 构建二进制 (make build): `go build -o bin/sql-driver-example`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 构建二进制 (make build): `go build -o bin/sql-driver-example`
- 构建二进制 (`make build`): `go build -o bin/sql-driver-example`

@@ -822,7 +822,7 @@ dsn := "root:123456@tcp(xxx.tidbcloud.com:4000)/test?charset=utf8mb4"

运行 `make all`,这是以下三个操作的组合:

- 创建表 (make mysql):`mysql --host 127.0.0.1 --port 4000 -u root<sql/dbinit.sql`
- 创建表 (make prepare):`mycli --host 127.0.0.1 --port 4000 -u root --no-warn < sql/dbinit.sql`
- 构建二进制 (make build): `go build -o bin/sql-driver-example`
- 运行 (make run): `./bin/sql-driver-example`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 运行 (make run): `./bin/sql-driver-example`
- 运行 (`make run`):`./bin/sql-driver-example`

@@ -30,93 +30,60 @@ aliases: ['/zh/tidb/dev/build-cluster-in-cloud']

## 第 2 步:连接到集群

1. 若未安装 MySQL 客户端,请选择自己的操作系统,按以下步骤安装。
1. 若未安装 MySQL 客户端,请选择自己的操作系统,按以下步骤安装。推荐使用 [mycli](https://www.mycli.net/),这是一个使用 Python 编写的 MySQL 客户端,其比 MySQL 官方的 mysql-client 更加智能和现代化。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. 若未安装 MySQL 客户端,请选择自己的操作系统,按以下步骤安装。推荐使用 [mycli](https://www.mycli.net/),这是一个使用 Python 编写的 MySQL 客户端,其比 MySQL 官方的 mysql-client 更加智能和现代化
1. 若未安装 MySQL 客户端,请根据你的操作系统,按以下步骤安装。推荐使用 [mycli](https://www.mycli.net/),这是一个使用 Python 编写的、对开发者友好的现代化 MySQL 客户端。


<SimpleTab>

<div label="macOS">

如果你没有安装 Homebrew,请移步 [Homebrew 官网](https://brew.sh/index_zh-cn)进行安装。
如果你没有安装 Homebrew,请移步 [Homebrew 官网](https://brew.sh/index_zh-cn)进行安装。安装后等待安装完毕即可:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
如果你没有安装 Homebrew,请移步 [Homebrew 官网](https://brew.sh/index_zh-cn)进行安装。安装后等待安装完毕即可:
使用 Hombrew 安装 `mycli`。如果你没有安装 Homebrew,请参考 [Homebrew 官网](https://brew.sh/index_zh-cn)进行安装。

</SimpleTab>

2. 运行第 1 步中得到的连接字符串。
则需改为运行:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
则需改为运行
则需修改为

## MySQL Client

你可以使用 MySQL Client 作为 TiDB 的命令行工具。在 [MySQL Shell 官方文档](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install.html) 你可以找到不同操作系统的安装方式。在安装完后你可以使用如下命令行连接到 TiDB:
PingCAP 推荐使用 [mycli](https://www.mycli.net/) 作为 TiDB 的命令行工具,这是一个使用 Python 编写的 MySQL 客户端,其比 MySQL 官方的 mysql-client 更加智能和现代化。在 [mycli 官方文档](https://www.mycli.net/install) 你可以找到不同操作系统的安装方式。在安装完后你可以使用如下命令行连接到 TiDB:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PingCAP 推荐使用 [mycli](https://www.mycli.net/) 作为 TiDB 的命令行工具,这是一个使用 Python 编写的 MySQL 客户端,其比 MySQL 官方的 mysql-client 更加智能和现代化。在 [mycli 官方文档](https://www.mycli.net/install) 你可以找到不同操作系统的安装方式。在安装完后你可以使用如下命令行连接到 TiDB:
推荐使用 [mycli](https://www.mycli.net/) 作为 TiDB 的命令行工具,这是一个使用 Python 编写的 MySQL 客户端、对开发者友好的现代化 MySQL 客户端。不同操作系统的 mycli 安装方式请参考 [mycli 官网](https://www.mycli.net/install)。安装完成后,你可以使用如下命令连接到 TiDB:

@@ -412,7 +413,7 @@ SHOW TABLES IN `bookshop`;

### `CREATE TABLE` 执行时应遵守的规则

- 不推荐使用客户端的 Driver 或 ORM 来执行数据库模式的更改。基于过往经验,建议使用 [MySQL 客户端](https://dev.mysql.com/doc/refman/8.0/en/mysql.html)或使用任意你喜欢的 GUI 客户端来进行数据库模式的更改。本文档中,将在大多数场景下,使用 **MySQL 客户端** 传入 SQL 文件来执行数据库模式的更改。
- 不推荐使用客户端的 Driver 或 ORM 来执行数据库模式的更改。基于过往经验,建议使用 [mycli 客户端](https://www.mycli.net/),这是一个使用 Python 编写的 MySQL 客户端,其比 MySQL 官方的 mysql-client 更加智能和现代化。或使用任意你喜欢的 GUI 客户端来进行数据库模式的更改。本文档中,将在大多数场景下,使用 **mycli 客户端** 传入 SQL 语句或 SQL 文件来执行数据库模式的更改。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 不推荐使用客户端的 Driver 或 ORM 来执行数据库模式的更改。基于过往经验,建议使用 [mycli 客户端](https://www.mycli.net/),这是一个使用 Python 编写的 MySQL 客户端,其比 MySQL 官方的 mysql-client 更加智能和现代化。或使用任意你喜欢的 GUI 客户端来进行数据库模式的更改。本文档中,将在大多数场景下,使用 **mycli 客户端** 传入 SQL 语句或 SQL 文件来执行数据库模式的更改。
- 不推荐使用客户端的 Driver 或 ORM 来执行数据库模式的更改。基于过往经验,建议使用 [mycli 客户端](https://www.mycli.net/),这是一个使用 Python 编写的、对开发者友好的现代化 MySQL 客户端。或使用任意你喜欢的 GUI 客户端来进行数据库模式的更改。本文档的大多数场景下,使用 **mycli 客户端** 传入 SQL 语句或 SQL 文件来执行数据库模式的更改。

@Icemap Icemap closed this Jun 7, 2022
@Icemap
Copy link
Member Author

Icemap commented Jun 7, 2022

不直接替换 mysql-client。而是使用 Tips 推荐 mycli

@Oreoxmt Oreoxmt added translation/no-need No need to translate this PR. and removed translation/doing This PR’s assignee is translating this PR. labels Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/develop This PR relates to the area of TiDB App development. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. translation/no-need No need to translate this PR. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants