(Resolved) Need to urlencode passwords in connection strings if they include # (MySQL) #452
Replies: 1 comment
-
I feel a bit silly – urlencoding the password before inserting it to the connection string works. I had tried this previously but had an error in my test. Leaving this here in case it is useful to others. Example jq usage: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TLDR: # symbol(s) in MySQL passwords in DATABASE_URL lead to a failure to connect.
Failure case: AWS RDS creates managed passwords containing special characters such as #. This leads to a failure of dbmate to connect to the database, as the connection string past the # is not properly parsed and the connection string ends up truncated.
--
Hi all,
Have been happily using dbmate with AWS RDS but have found that the RDS-managed passwords often insert non-alphanumeric characters such as $, !, :, and # to automatically-managed passwords. The pound sign in particular does not seem to work with dbmate, as it doesn't get parsed correctly, and as a result, dbmate cannot connect to the RDS instance. I confirmed that MySQL Workbench has no problem with the same database and password. I also tried every version of escaping the pound sign (with \, '', "", etc.) that I could find, but the problem persists. Is this behavior a bug?
I am not sure if this is a dbmate-specific issue or if MySQL connection strings in general do not support the # sign (related issue). Some digging on Oracle's site did not confirm. Either way, it would be nice to have an option to connect using the #-bearing passwords, as AWS RDS instances are very common and cannot be configured to exclude the pound sign from auto-managed passwords.
I am cognizant of the call for maintainers and happy to contribute if possible.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions