-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
[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 The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
|
||
以 CentOS 7 为例: | ||
请参考 [mycli 安装页面](https://www.mycli.net/install),推荐使用其中的 **Python Package** 章节,即使用 pip 包管理器进行安装。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请参考 [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。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另外,因为一个[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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 创建表 (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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 构建二进制 (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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 运行 (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 更加智能和现代化。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)进行安装。安装后等待安装完毕即可: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果你没有安装 Homebrew,请移步 [Homebrew 官网](https://brew.sh/index_zh-cn)进行安装。安装后等待安装完毕即可: | |
使用 Hombrew 安装 `mycli`。如果你没有安装 Homebrew,请参考 [Homebrew 官网](https://brew.sh/index_zh-cn)进行安装。 |
</SimpleTab> | ||
|
||
2. 运行第 1 步中得到的连接字符串。 | ||
则需改为运行: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
则需改为运行: | |
则需修改为: |
## 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 文件来执行数据库模式的更改。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 不推荐使用客户端的 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 文件来执行数据库模式的更改。 |
不直接替换 |
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).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?