-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Passwords with slashes breaks parsing of --db-url #1134
Comments
Related issue: #1129 |
The connect string is a URL scheme, you should urlencode your password as a slash character will mess things up. The other issue is not quite the same. |
Could you please test this again, URL-encoding your password, and see if Drush / parse_url correctly unencodes the password? If that works, we can update the documentation and close this + #1129. |
As I mentioned there, I URL-encoded the password and it works fine, which is the problem with this issue. |
Yes, URL-encoding the password works. It will help if we update the documentation. I also think we should help the user - do some minimal sanity checks of the format (and the result of the parsing) and warn the user. I can write a patch for this if it sounds interesting. #1129 is different. |
I'm auto-generating passwords for MySQL and tried to use one of them when running site-install. It failed. It took some tries before I noticed the problem - see simplified example:
The database name is wrong because of the slash in the password - '34@localhost/drush_si_test' versus the expected 'drush_si_test'. The reason this happens is that function drush_convert_db_from_db_url (in includes/sitealias.inc) uses parse_url to parse the DB URL.
One solution is to document that Drush doesn't support passwords with slashes. Another is to introduce some type of escaping of the slash.
I think the best fix is to parse the db-url string manually. I'm happy to write a patch if people think Drush should handle passwords with slashes.
PS! This has been discussed and turned down before - see https://www.drupal.org/node/1526858
The text was updated successfully, but these errors were encountered: