I am using a docker container to run a mysql server for local developement of a golang application from my host machine, the problem is,I have tried to connect to it using various clients and it always connects successfully, but returns errors when running queries, for example in sqltools for vscode:
Request connection/GetChildrenForTreeItemRequest failed with message:
ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server;
consider upgrading MySQL client
When I try to connect with golang I get:
go run ./cmd/web
ERROR 2021/12/16 04:28:55 main.go:32: Error 1045: Access denied for user 'web'@'172.18.0.1' (using password: YES)
exit status 1
(Golang data source is "user:pass@/database?parseTime=true" using the mysql driver)
DBeaver however, is able to connect succesfully, but if I try to do it without changing any settings, I get the following message:
Connection error:
Public Key Retrieval is not allowed
So, going to driver settings and changing "allowPublicKeyRetrieval" from "false" to "true" will make everything work fine.
Is there any way to allow this "public key retrieval" using the golang driver? Is there something I can change from the mysql console so this is not needed? I couldn't see anything in the documentation ( https://github.com/go-sql-driver/mysql ) and I can't continue with my project until I figure out a way to connect it successfully :(