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

createConnection(string) does not support URL-encoded credentials #115

Closed
cedx opened this issue Jun 14, 2020 · 1 comment
Closed

createConnection(string) does not support URL-encoded credentials #115

cedx opened this issue Jun 14, 2020 · 1 comment

Comments

@cedx
Copy link

cedx commented Jun 14, 2020

In a URL, user/password must be URL-encoded if they contain special characters.
Let's say the password is foo@bar: the corresponding string is foo%40bar.

So if we use a connection string to open a connection, the user/password must be URL-decoded otherwise an error occurs:

mariadb.createConnection("mariadb://user:foo%40bar@localhost:3306/db");
# Error: (conn=9, no: 1045, SQLState: 28000) Access denied for user 'user'@'localhost' (using password: YES)

See: https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/lib/config/connection-options.js#L210
Credentials are passed as-is.

@rusher
Copy link
Collaborator

rusher commented Jul 1, 2020

This will be part of 2.4.1 version with correction above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants