tidb: Fail to connect to TiDB using the mysql 8.0 client

  1. What did you do?
$ mysql --version
mysql  Ver 8.0.12 for Linux on x86_64 (MySQL Community Server - GPL)
$ mysql -h 47.100.x.x -p -P 4000 -u root
  1. What did you expect to see? mysql client works.

  2. What did you see instead?

$ mysql -h 47.100.x.x -p -P 4000 -u root
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'221.12.20.22' (using password: YES)

tidb.log:

2018/09/04 17:43:20.146 terror.go:345: [error] lookup 22.20.12.221.in-addr.arpa. on 100.100.2.136:53: no such host
/home/jenkins/workspace/build_tidb_master/go/src/github.com/pingcap/tidb/session/session.go:1041: 
2018/09/04 17:43:20.146 session.go:1032: [error] User connection verification failed root@221.12.20.22
2018/09/04 17:43:31.199 gc_worker.go:293: [info] [gc worker] leaderTick on 596279b443c0003: gc interval (10m0s) haven't past since last run (2018-09-04 17:35:31 +0800 CST). no need to gc

And i found mysql-client-5.7 is ok:

$ mysql --version
mysql  Ver 14.14 Distrib 5.7.23, for Linux (x86_64) using  EditLine wrapper
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
Release Version: v2.1.0-rc.1-22-g55af7e1
Git Commit Hash: 55af7e147269dac05a9741aa461e736a264520c9
Git Branch: master
UTC Build Time: 2018-08-29 03:42:01
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false 

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Last weak, i upgraded tidb to 2.1 and got the same error on mysql client 8.0.13.

Today i find that connect tidb with --default-auth=mysql_native_password is ok:

mysql -h xxx.net -u root -p -P 4000 --default-auth=mysql_native_password

Have you ever change the root password? @meilihao Make sure you’re using the right password, I guess that’s the problem. Don’t bother with the “no such host” in the error message, it’s misleading.