-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
could not use requested auth plugin 'mysql_native_password': this user requires mysql native password authentication. #1256
Comments
// Capture connection properties.
cfg := mysql.Config{
User: os.Getenv("DBUSER"),
Passwd: os.Getenv("DBPASS"),
Net: "tcp",
Addr: "127.0.0.1:3306",
DBName: "recordings",
} This is a bug. See https://pkg.go.dev/github.com/go-sql-driver/mysql#Config
In other words, you didn't use default value. |
Could you post example code for the record please and thanks. |
PLEASE REOPEN THIS. @methane you are full of gas!! You mention there is a bug, you do not give a work around, and you close the bug. Please do not do this. This seems to be a pattern in your issue queue. This is not a usable driver right now on MacOS, and possibly other OS. |
READ MY REPLY CAREFULLY.
I don't know what "full of gas" mean.
I mentioned the bug is in the example code above.
Yes, it is a pattern in this issue tracker. Many users don't read document carefully. They believe bug in this driver, not in their code. And they ask such questions as maintainers should be free tech support. This is very big issue about OSS sustainability. You should do:
|
@methane: I do know that OSS work can be thankless at times, and I am sorry if I burdened you unduly. But I do think you are closing down issues too quickly. It's possible that some of the issues here are upstream. But people will experience them first via your code. I'm not surprised why these issues appear in your queue, for that reason. But very arguably, when upstream issues dribble downwards into code you create, it's important that a library be coded defensively to keep code that relies upon your library stable. When you repeated get similar issues reported on your queue, rather than condemn your users, see if you can be of help. As a concrete example, look at your comment above:
First of all, your link was not directly on point. It's unclear what you were referring to, In particular, what default value you were talking about. You recommend using the mysql.NewConfig API. But it's unclear how; having tried it, I got different backend responses, depending upon how I used it. A small amount of sample code would have helped your user, made clear how to work around the upstream bug you refer to, and frankly, would have been much kinder on your part. I don't want to be overly hard on you, but this is a frustrating library to deal with, since the user queue is getting shut down because you are not taking your users' issues seriously. If you'll be a bit more positive about the feedback, possibly your users will also be more positive and perhaps more helpful to other users in issues. Or in terms of submitting patches. |
No. I don't want to be a free tech support.
If you read it carefully, it is very clear.
Then you must know the default value means something allowing native password. (But not only it. Default values including some others. See code for detail.) And if you click the link, you must see this member in Confg:
You must see it by using your 3 minutes. On the other hand, I needed to more than 20 minutes for this reply. Note that I am not native English speaker and I am not good at English. This is why I don't want to be "free tech support". DO NOT blame maintainers when you feel they not kind enough. Motivation and time is very limited resource for OSS sustainability. Of course, I don't close issues when issue report include enough information to suspect this driver.
As my long life as OSS maintainer, this is not true. Users don't watch all issues on issue tracker. They watch only issue they subscribe. Only maintainer read all issues. That's why I asked to "ask such question in Go or MySQL community." On Gophers Slack, golang-nuts mailing list, many kind Gophers can help you. |
This comment was marked as spam.
This comment was marked as spam.
DO NOT WRITE BAD ANSWER!! I said don't use Use |
Calm down, methane, I didn't mean to upset you that much. I just wanted to spare other Go beginners the frustration they will have following the instructions of the mentioned Go tutorial on their official website. When searching for the bug, this page is one of the first results. I was also explicitly addressing only those people coming from this tutorial who may not have the knowledge yet to know how to replace the given struct with the |
Wrong advice doesn't help beginners. Beginners should learn how to use the API correctly. |
Issue description
On following golang's tutorial on what to use go-mysql https://golang.org/doc/tutorial/database-access i get the error message on go run . When I type in mysql -u I get Access denied for user 'james'@'localhost' (using password: NO)
Error log
ERROR 1045 (28000): Access denied for user 'james'@'localhost' (using password: NO)
Configuration
Driver version (or git SHA): - unknown
Go version: run
go version
1.17Server version: E.g. MySQL 5.6,
Server OS: E.g. linux mint . 5.7.35-ubuntu 18.04.1
The text was updated successfully, but these errors were encountered: