-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Enable native authentication in MySQL #6628
Enable native authentication in MySQL #6628
Conversation
receiver/mysqlreceiver/client.go
Outdated
Net: conf.Transport, | ||
Addr: conf.Endpoint, | ||
DBName: conf.Database, | ||
AllowNativePasswords: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems wrong to just add this without giving users the chance to customize it. Besides, the default value for this seems to indeed be true: what would this change bring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the default was incorrect in testing as it was building the DSN by setting this parameter to false. I'll add it as a config option but default to true.
receiver/mysqlreceiver/README.md
Outdated
@@ -19,6 +19,7 @@ The following settings are optional: | |||
- `endpoint`: (default = `localhost:3306`) | |||
- `username`: (default = `root`) | |||
- `password`: The password to the username. | |||
- `AllowNativePasswords`: (default = `true`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `AllowNativePasswords`: (default = `true`) | |
- `allow_native_passwords`: (default = `true`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
receiver/mysqlreceiver/config.go
Outdated
@@ -24,5 +24,6 @@ type Config struct { | |||
Username string `mapstructure:"username,omitempty"` | |||
Password string `mapstructure:"password,omitempty"` | |||
Database string `mapstructure:"database,omitempty"` | |||
AllowNativePasswords bool `mapstructure:"database,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AllowNativePasswords bool `mapstructure:"database,omitempty"` | |
AllowNativePasswords bool `mapstructure:"allow_native_passwords,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Bit of cleanup left over from #6322.
Description:
Add support for native authentication in mysql.