Skip to content

Commit

Permalink
Add note about default-auth for MySQL 8.0 clients (pingcap#3969)
Browse files Browse the repository at this point in the history
* 若要使用 MySQL 8.0 的连接器连接到 TiDB,你必须显示地指定 `default-auth=mysql_native_password`,因为 `mysql_native_password` 不再是[默认的插件](https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password)。

* Apply suggestions from code review

Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>

Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 17, 2020
1 parent 7f65b52 commit 8e5278a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions connectors-and-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ TiDB 兼容 MySQL(5.6、5.7) 的所有连接器和 API,包括:
+ [MySQL Eiffel Wrapper](https://dev.mysql.com/doc/refman/5.7/en/apis-eiffel.html)
+ [Mysql Go API](https://github.com/go-sql-driver/mysql)

> **注意:**
>
> 若要使用 MySQL 8.0 的连接器连接到 TiDB,你必须显式地指定 `default-auth=mysql_native_password`,因为 `mysql_native_password` 不再是[默认的插件](https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password)
## 使用 MySQL 连接器连接 TiDB

Oracle 官方提供了以下 API,TiDB 可以兼容所有这些 API。
Expand Down
1 change: 1 addition & 0 deletions security-compatibility-with-mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ aliases: ['/docs-cn/dev/reference/security/compatibility/']
除以下功能外,TiDB 支持与 MySQL 5.7 类似的安全特性。

- 仅支持 `mysql_native_password` 密码验证或证书验证登陆方案。
- MySQL 8.0 中,`mysql_native_password` 不再是[默认/推荐的插件](https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password)。若要使用 MySQL 8.0 的连接器连接到 TiDB,你必须显式地指定 `default-auth=mysql_native_password`
- 不支持外部身份验证方式(如 LDAP)。
- 不支持列级别权限设置。
- 不支持密码过期,最后一次密码变更记录以及密码生存期。[#9709](https://github.com/pingcap/tidb/issues/9709)
Expand Down
2 changes: 1 addition & 1 deletion tidb-specific-system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ mysql> desc select count(distinct a) from test.t;

这个变量用来给 TiDB 的 `backoff` 最大时间增加权重,即内部遇到网络或其他组件(TiKV、PD)故障等时,发送重试请求的最大重试时间。可以通过这个变量来调整最大重试时间,最小值为 1。

例如,TiDB 向 PD 取 TSO 的基础超时时间是 15 秒,当 `tidb_backoff_weight = 2` 时,取 TSO 的最大超时时间为:基础时间 * 2 等于 30 秒。
例如,TiDB 向 PD 取 TSO 的基础超时时间是 15 秒,当 `tidb_backoff_weight = 2` 时,取 TSO 的最大超时时间为:基础时间 \* 2 等于 30 秒。

在网络环境较差的情况下,适当增大该变量值可以有效缓解因为超时而向应用端报错的情况;而如果应用端希望更快地接到报错信息,则应该尽量减小该变量的值。

Expand Down
4 changes: 4 additions & 0 deletions user-account-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ mysql --port 4000 --user xxx --password
mysql -P 4000 -u xxx -p
```

> **Note:**
>
> 若要使用 MySQL 8.0 的连接器连接到 TiDB,你必须显式地指定 `default-auth=mysql_native_password`,因为 `mysql_native_password` 不再是[默认的插件](https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password)
## 添加用户

添加用户有两种方式:
Expand Down

0 comments on commit 8e5278a

Please sign in to comment.