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

Error with handling passwords with symbols #478

Closed
ghost opened this issue Jan 14, 2014 · 7 comments
Closed

Error with handling passwords with symbols #478

ghost opened this issue Jan 14, 2014 · 7 comments

Comments

@ghost
Copy link

ghost commented Jan 14, 2014

When connecting to my remote database with a mysql client I had no problem, but connecting through Mysql2 I keep getting access denied.

I was able to figure out the reason. For some reason or another Mysql2 doesn't properly handle symbols in passwords. In this instance, I had the symbol '$' in my password which was messing something up.

I am unsure if this was intentional and written down somewhere but I found no documentation restricting password characters, and again, it worked with the mysql client.

@sodabrew
Copy link
Collaborator

Sounds like a bug. Version of mysql2 gem that you're using?

@ghost
Copy link
Author

ghost commented Jan 14, 2014

Looks like mysql2, 0.3.14.

@sodabrew
Copy link
Collaborator

Please try mysql2 0.3.13 as well, let's see if this was a recently introduced issue.

@ghost
Copy link
Author

ghost commented Jan 14, 2014

Unfortunately it was on a production system so I can't easily test that. I can try to reproduce it on 0.3.13 on another system later.

If it helps, the symbol was at the start of the password ex: "$foobar1234"

@sodabrew
Copy link
Collaborator

Are you still seeing this problem? I'm not able to reproduce it.

@sodabrew
Copy link
Collaborator

Closing for lack of updates.

@ghost
Copy link
Author

ghost commented Jul 29, 2014

I think it can be closed, the error may have been mine. I was storing the password within an environment variable, ex: foo=$asdf. The problem seems to be the "$" wasn't escaped, it should have been: foo=$asdf.

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

1 participant