-
Notifications
You must be signed in to change notification settings - Fork 26
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
TiProxy is incompatible with go-sql-driver 1.3.0 #325
Comments
Why does TiProxy send an auth switch method if go-sql-driver sends a login with |
Because clients handshaked with tiproxy first: clients got wrong salt data from tiproxy. So we must file auth-switch packets to let clients auth with the real server. This is a hard limitation if tiproxy did not establish connections to server before handshaking with clients. |
Ah yes. That makes sense. Connecting to the backend when receiving a connection before responding to the client could fix this, but go-sql-driver v1.4.0 has been released many years ago so asking users to upgrade seems fine with me. go-sql-driver v1.4.0 is also needed for |
Yes, that is the point. It is pretty much a problem of mysql protocol. I mean that, for mysql, server sent the first packet.. 🥲 |
TiProxy did this before, but now TiProxy needs to connect to the correct TiDB server based on the user name, which is obtained in the response packet. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
No error
3. What did you see instead (Required)
Driver reports
this user requires mysql native password authentication
.4. What is your version? (Required)
master.
The reason:
mysql_native_password
. But when TiProxy requests to switch auth method tomysql_native_password
, go-sql-driver just reportsErrNativePassword
. See https://github.com/go-sql-driver/mysql/blob/v1.3.0/packets.go#L495-L497. I think there's no way to avoid this problem on TiProxy side.The text was updated successfully, but these errors were encountered: