From 87880e3d46617853206bdc0618e8f49f918a83ce Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Tue, 9 Jun 2020 17:29:56 +0800 Subject: [PATCH 1/7] faq: update mysql8 client fail to connect tidb --- faq/tidb-faq.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/faq/tidb-faq.md b/faq/tidb-faq.md index ebc607a1c68d1..4f0b60fc2773e 100644 --- a/faq/tidb-faq.md +++ b/faq/tidb-faq.md @@ -41,6 +41,14 @@ Yes, it is. When all the required services are started, you can use TiDB as easi Currently, TiDB supports the majority of MySQL 5.7 syntax, but does not support trigger, stored procedures, user-defined functions, and foreign keys. For more details, see [Compatibility with MySQL](/mysql-compatibility.md). +When using the MySQL 8.0 client, if it fails to connect to TiDB, try to add the `default-auth` and `default-character-set` options: + +``` +mysql -h 127.0.0.1 -u root -P 4000 --default-auth=mysql_native_password --default-character-set=utf8 +``` + +This problem is caused by charset and [authentication scheme related compatibility](/security-compatibility-with-mysql.md). + #### How is TiDB highly available? TiDB is self-healing. All of the three components, TiDB, TiKV and PD, can tolerate failures of some of their instances. With its strong consistency guarantee, whether it’s data machine failures or even downtime of an entire data center, your data can be recovered automatically. For more information, see [TiDB architecture](/architecture.md). From afaca754b4d46da686c46ea4eb1b838913da3821 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Thu, 9 Jul 2020 10:44:43 +0800 Subject: [PATCH 2/7] Update faq/tidb-faq.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- faq/tidb-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faq/tidb-faq.md b/faq/tidb-faq.md index 4f0b60fc2773e..0bc689a9da113 100644 --- a/faq/tidb-faq.md +++ b/faq/tidb-faq.md @@ -41,7 +41,7 @@ Yes, it is. When all the required services are started, you can use TiDB as easi Currently, TiDB supports the majority of MySQL 5.7 syntax, but does not support trigger, stored procedures, user-defined functions, and foreign keys. For more details, see [Compatibility with MySQL](/mysql-compatibility.md). -When using the MySQL 8.0 client, if it fails to connect to TiDB, try to add the `default-auth` and `default-character-set` options: +If you use the MySQL 8.0 client and it fails to connect to TiDB, try to add the `default-auth` and `default-character-set` options: ``` mysql -h 127.0.0.1 -u root -P 4000 --default-auth=mysql_native_password --default-character-set=utf8 From 12c70dfb7aa4074c82535c8abeac6ec84227f0dd Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Thu, 9 Jul 2020 10:44:56 +0800 Subject: [PATCH 3/7] Update faq/tidb-faq.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- faq/tidb-faq.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/faq/tidb-faq.md b/faq/tidb-faq.md index 0bc689a9da113..e639ff80f65f8 100644 --- a/faq/tidb-faq.md +++ b/faq/tidb-faq.md @@ -43,6 +43,8 @@ Currently, TiDB supports the majority of MySQL 5.7 syntax, but does not support If you use the MySQL 8.0 client and it fails to connect to TiDB, try to add the `default-auth` and `default-character-set` options: +{{< copyable "shell-regular" >}} + ``` mysql -h 127.0.0.1 -u root -P 4000 --default-auth=mysql_native_password --default-character-set=utf8 ``` From 8c52d65744d9ae9986c07c9b697b2e07d18e3643 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Thu, 9 Jul 2020 10:45:15 +0800 Subject: [PATCH 4/7] Update faq/tidb-faq.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- faq/tidb-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faq/tidb-faq.md b/faq/tidb-faq.md index e639ff80f65f8..c383edb3d94e7 100644 --- a/faq/tidb-faq.md +++ b/faq/tidb-faq.md @@ -45,7 +45,7 @@ If you use the MySQL 8.0 client and it fails to connect to TiDB, try to add the {{< copyable "shell-regular" >}} -``` +```shell mysql -h 127.0.0.1 -u root -P 4000 --default-auth=mysql_native_password --default-character-set=utf8 ``` From 8fc20acd981d8cd0f3a6cc401e3144d547a7f8e8 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Thu, 9 Jul 2020 10:45:30 +0800 Subject: [PATCH 5/7] Update faq/tidb-faq.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- faq/tidb-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faq/tidb-faq.md b/faq/tidb-faq.md index c383edb3d94e7..3081de2de8cea 100644 --- a/faq/tidb-faq.md +++ b/faq/tidb-faq.md @@ -49,7 +49,7 @@ If you use the MySQL 8.0 client and it fails to connect to TiDB, try to add the mysql -h 127.0.0.1 -u root -P 4000 --default-auth=mysql_native_password --default-character-set=utf8 ``` -This problem is caused by charset and [authentication scheme related compatibility](/security-compatibility-with-mysql.md). +This problem occurs because MySQL 8.0 changes the [authentication plugin](/security-compatibility-with-mysql.md) default in MySQL 5.7. To solve this problem, you need to add the options above to specify using the old encryption method. #### How is TiDB highly available? From dbe109c2ad95fe685b23f3199542f786f4b4c55a Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Thu, 9 Jul 2020 10:46:12 +0800 Subject: [PATCH 6/7] Update faq/tidb-faq.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- faq/tidb-faq.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/faq/tidb-faq.md b/faq/tidb-faq.md index 3081de2de8cea..1e4a1290ee8a8 100644 --- a/faq/tidb-faq.md +++ b/faq/tidb-faq.md @@ -45,6 +45,8 @@ If you use the MySQL 8.0 client and it fails to connect to TiDB, try to add the {{< copyable "shell-regular" >}} +{{< copyable "shell-regular" >}} + ```shell mysql -h 127.0.0.1 -u root -P 4000 --default-auth=mysql_native_password --default-character-set=utf8 ``` From 5d3d4bbf0b3a377b736af6886367318f7e8cb384 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Thu, 9 Jul 2020 11:59:36 +0800 Subject: [PATCH 7/7] Update tidb-faq.md --- faq/tidb-faq.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/faq/tidb-faq.md b/faq/tidb-faq.md index 076e934814c18..03cc0a6bf2dee 100644 --- a/faq/tidb-faq.md +++ b/faq/tidb-faq.md @@ -45,8 +45,6 @@ If you use the MySQL 8.0 client and it fails to connect to TiDB, try to add the {{< copyable "shell-regular" >}} -{{< copyable "shell-regular" >}} - ```shell mysql -h 127.0.0.1 -u root -P 4000 --default-auth=mysql_native_password --default-character-set=utf8 ```