Skip to content
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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions receiver/mysqlreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ var _ client = (*mySQLClient)(nil)

func newMySQLClient(conf *Config) client {
driverConf := mysql.Config{
User: conf.Username,
Passwd: conf.Password,
Net: conf.Transport,
Addr: conf.Endpoint,
DBName: conf.Database,
User: conf.Username,
Passwd: conf.Password,
Net: conf.Transport,
Addr: conf.Endpoint,
DBName: conf.Database,
AllowNativePasswords: true,
Copy link
Member

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?

https://pkg.go.dev/github.com/go-sql-driver/mysql#Config

Copy link
Contributor Author

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.

}
connStr := driverConf.FormatDSN()

Expand Down