Skip to content

Conversation

@kolbe
Copy link
Contributor

@kolbe kolbe commented Jun 3, 2020

What is changed, added or deleted? (Required)

The MySQL command line client (mysql) as well as the libmysqlclient client library have changed their default authentication plugin. See https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password for more information about that change.

It's no longer possible to connect to a TiDB Server using those clients if the user account has a password set, unless the default-auth=mysql_native_password option is used.

This behavior can be seen in this example:

mysql> create user myuser identified by 'password';
Query OK, 0 rows affected (0.05 sec)

$ mysql --version
mysql  Ver 8.0.19 for osx10.15 on x86_64 (Homebrew)

$ mysql -u myuser -ppassword
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'myuser'@'127.0.0.1' (using password: NO)

Note that the error message says "using password: NO", even though a password is given on the command line.

The --default-auth=mysql_native_passwword option allows the connection to succeed:

$ mysql -u myuser -ppassword --default-auth=mysql_native_password -e 'select version()'
mysql: [Warning] Using a password on the command line interface can be insecure.
+------------------------------------------+
| version()                                |
+------------------------------------------+
| 5.7.25-TiDB-v4.0.0-beta.2-443-ge0ec3e3ca |
+------------------------------------------+

This patch makes several updates to pages in the documentation that deal with MySQL compatibility, setting passwords, and connecting to TiDB using MySQL clients.

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

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

If you select two or more versions from above, to trigger the bot to cherry-pick this PR to your desired release version branch(es), you must add corresponding labels such as needs-cherry-pick-4.0, needs-cherry-pick-3.1, needs-cherry-pick-3.0, and needs-cherry-pick-2.1.

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

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

@yikeke yikeke requested a review from jackysp June 9, 2020 03:39
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@yikeke yikeke left a comment

Choose a reason for hiding this comment

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

LGTM

@yikeke
Copy link
Contributor

yikeke commented Jun 9, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 9, 2020
@yikeke yikeke added the translation/doing This PR's assignee is translating this PR. label Jun 9, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Jun 9, 2020

/run-all-tests

@sre-bot sre-bot merged commit 305ea1f into pingcap:master Jun 9, 2020
sre-bot pushed a commit to sre-bot/docs that referenced this pull request Jun 9, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Jun 9, 2020

cherry pick to release-2.1 in PR #2741

sre-bot pushed a commit to sre-bot/docs that referenced this pull request Jun 9, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Jun 9, 2020

cherry pick to release-3.0 in PR #2742

sre-bot pushed a commit to sre-bot/docs that referenced this pull request Jun 9, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Jun 9, 2020

cherry pick to release-3.1 in PR #2743

sre-bot pushed a commit to sre-bot/docs that referenced this pull request Jun 9, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Jun 9, 2020

cherry pick to release-4.0 in PR #2744

sre-bot added a commit that referenced this pull request Jun 9, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
sre-bot added a commit that referenced this pull request Jun 9, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
sre-bot added a commit that referenced this pull request Jun 9, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
sre-bot added a commit that referenced this pull request Jun 9, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@TomShawn TomShawn added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR's assignee is translating this PR. labels Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/can-merge Indicates a PR has been approved by a committer. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants