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

Support MySQL 8.0 connectors #17875

Closed
tennix opened this issue Jun 9, 2020 · 6 comments · Fixed by #19603
Closed

Support MySQL 8.0 connectors #17875

tennix opened this issue Jun 9, 2020 · 6 comments · Fixed by #19603
Labels
feature/accepted This feature request is accepted by product managers security Everything related with security type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@tennix
Copy link
Member

tennix commented Jun 9, 2020

Feature Request

Is your feature request related to a problem? Please describe:

When a TiDB cluster has set password, users cannot connect to it with MySQL 8.0 client as usual: mysql -h ${tidb_endpoint} -P 4000 -u root -p. This is because MySQL 8.0 client has changes the default encryption method for password. The following tow issues have details about this.

#6942
#7606

https://docs.pingcap.com/zh/tidb/v4.0/security-compatibility-with-mysql

Describe the feature you'd like:

I would like TiDB to support MySQL 8.0 client.

Though users can workaround this as documented here pingcap/docs-cn#3577, some programs such as Sysbench is dynamically linked to the system MySQL client library and does not have options to configure these parameters (--default-auth=mysql_native_password and --default-character-set=utf8).

So it would be too difficult for users to benchmark TiDB using Sysbench if they have MySQL 8.0 client installed.

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

@tennix tennix added the type/feature-request Categorizes issue or PR as related to a new feature. label Jun 9, 2020
@wwar
Copy link

wwar commented Jun 9, 2020

There might be an easy way to implement this. The mysql protocol has a way for the server to tell clients to reauthenticate with a different authentication plugin (so mysql_native_password instead of caching_sha256_password).

@djshow832 djshow832 added the security Everything related with security label Jun 10, 2020
@scsldb scsldb added the feature/reviewing This feature request is reviewing by product managers label Jul 16, 2020
@zz-jason
Copy link
Member

I can connect to TiDB without --default-character-set=utf8:

➜ mysql -h 127.0.0.1 -P 4000 -u root -D test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.25-TiDB-v4.0.0-beta.2-801-g94fc46424 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ^DBye

The MySQL client version:

➜ mysql --version
mysql  Ver 8.0.21 for osx10.15 on x86_64 (Homebrew)

The tidb-server version:

➜ ./bin/tidb-server -V
Release Version: v4.0.0-beta.2-801-g94fc46424
Edition: Community
Git Commit Hash: 94fc46424f952dd7337bbc6cf7120312637caa28
Git Branch: master
UTC Build Time: 2020-07-20 07:58:07
GoVersion: go1.13.12
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

@zz-jason
Copy link
Member

@tennix What's your TiDB and MySQL client version?

@zz-jason zz-jason removed the feature/reviewing This feature request is reviewing by product managers label Jul 21, 2020
@zz-jason zz-jason removed their assignment Jul 21, 2020
@zz-jason zz-jason added the feature/accepted This feature request is accepted by product managers label Jul 29, 2020
@ghost ghost changed the title Support MySQL 8.0 client Support caching_sha256_password authentication plugin Aug 12, 2020
@ghost
Copy link

ghost commented Aug 12, 2020

I believe the character set issue was fixed between TiDB 2.1 and TiDB 3.0-ish. I have updated the title to be specifically about the sha256 auth plugin.

@ghost
Copy link

ghost commented Aug 30, 2020

This is a duplicate of #9411

@ghost ghost changed the title Support caching_sha256_password authentication plugin Support MySQL 8.0 connectors Aug 31, 2020
@ghost
Copy link

ghost commented Aug 31, 2020

I took a look at the "easy way to implement this", and it does indeed work. So I have created a PR in #19603

I will leave #9411 open as a request to actually implement caching_sha2_password, which has its own security merits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/accepted This feature request is accepted by product managers security Everything related with security type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants