Skip to content

Auth failed for u1@127.% #29709

@djshow832

Description

@djshow832

Bug Report

Please answer these questions before submitting your issue. Thanks!

This is a bug introduced by #24991.

1. Minimal reproduce step (Required)

mysql -h127.1 -uroot -P4000
mysql> create user u1@'127.%';
Query OK, 0 rows affected (0.00 sec)
mysql -h127.1 -uu1 -P4000
ERROR 2000 (HY000): Unknown MySQL error

2. What did you expect to see? (Required)

In MySQL and older TiDB versions, u1 can log in as usual.

3. What did you see instead (Required)

mysql -h127.1 -uu1 -P4000
ERROR 2000 (HY000): Unknown MySQL error

In TiDB log:

[2021/11/12 09:58:37.805 +08:00] [WARN] [conn.go:712] ["failed to check the user authplugin"] [conn=5] [error="Failed to get user record"]
[2021/11/12 09:58:37.806 +08:00] [ERROR] [conn.go:757] ["authSha packet read failed"] [conn=5] [error=EOF]
[2021/11/12 09:58:37.806 +08:00] [ERROR] [terror.go:307] ["encountered error"] [error=EOF] 

4. What is your TiDB version? (Required)

Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions