-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[0.11.0] URL parse for mysql connection string fails with special characters in password #870
Comments
Same issue. |
@burdandrei @lnkisi Thanks for reporting this bug, I will fix it soon. |
@burdandrei @lnkisi |
@maksadbek well this is strange, |
see also #1842 |
The MySQL DB driver has it's own DSN parsing function. Previously we were using the url.Parse function, but this causes problems because a valid MySQL DSN can be an invalid http URL, namely when using some special characters in the password. This change uses the MySQL DB driver's builtin ParseDSN function and applies a timeout parameter natively via that. Another benefit of this change is that we fail earlier if given an invalid MySQL DSN. closes #870 closes #1842
The MySQL DB driver has it's own DSN parsing function. Previously we were using the url.Parse function, but this causes problems because a valid MySQL DSN can be an invalid http URL, namely when using some special characters in the password. This change uses the MySQL DB driver's builtin ParseDSN function and applies a timeout parameter natively via that. Another benefit of this change is that we fail earlier if given an invalid MySQL DSN. closes #870 closes #1842
The MySQL DB driver has it's own DSN parsing function. Previously we were using the url.Parse function, but this causes problems because a valid MySQL DSN can be an invalid http URL, namely when using some special characters in the password. This change uses the MySQL DB driver's builtin ParseDSN function and applies a timeout parameter natively via that. Another benefit of this change is that we fail earlier if given an invalid MySQL DSN. closes #870 closes #1842
Has this issue been fixed? I'm using v1.2.1. Seems like this issue still exists |
@adityask2 The fix above should be in 1.2.1, can you open a new issue and include a sample connection string that replicates your issue. |
I got "%j+" sequence in my mysql password, and now because url.Parse it fails:
https://github.com/influxdata/telegraf/blob/master/plugins/inputs/mysql/mysql.go#L225
Per original Package documentation special characters supported in password and should not be escaped:
https://github.com/go-sql-driver/mysql/blob/master/README.md#password
There is ParseDSN method in package:
https://github.com/go-sql-driver/mysql/blob/master/dsn.go#L245
The text was updated successfully, but these errors were encountered: