Closed (fixed)
Project:
Drush
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
14 Apr 2009 at 19:45 UTC
Updated:
8 May 2009 at 11:50 UTC
Jump to comment: Most recent file
My MySQL password contains a $, which prevents drush from bootstrapping the Drupal database. Could be a duplicate of #348160: MySQL access denied problem. The $ is translated to %24 in settings.php as per
* Note that the $db_url variable gets parsed using PHP's built-in
* URL parser (i.e. using the "parse_url()" function) so make sure
* not to confuse the parser. If your username, password
* or database name contain characters used to delineate
* $db_url parts, you can escape them via URI hex encodings:
*
* : = %3a / = %2f @ = %40
* + = %2b ( = %28 ) = %29
* ? = %3f = = %3d & = %26
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | drush-433652-11.patch | 1.22 KB | kdebaas |
| #9 | url3.patch | 2.89 KB | kdebaas |
| #6 | url.patch | 1.76 KB | kdebaas |
| #5 | drush-HEAD-2009_04_19.patch | 1.51 KB | khorpyakov |
Comments
Comment #1
moshe weitzman commentedComment #2
moshe weitzman commentedComment #3
kkaefer commentedI can confirm that this is happening. Apparently the password is not decoded but used as is.
Comment #4
grahamcI was having issues with special characters in my mysql password too.
I don't think it's anything to do with characters being uri encoded though, merely that special shell characters aren't being escaped. Amending _drush_sql_get_credentials() to put the password string through escapeshellarg() did the trick for me.
Comment #5
khorpyakov commentedComment #6
kdebaas commentedAbove patch works for me. However, shouldn't the mysql user and database name receive the same treatment, as in attached patch?
Comment #7
moshe weitzman commentedWell done ... I think the new postgres section of that function needs the same treatment ... Also, should we use escapeshllarg() elsewhere such is in eval command?
Comment #8
khorpyakov commentedyeah and use escapeshellcmd because it escapes not only single and double quotes but all the special characters (including ! in my case).
Comment #9
kdebaas commentedI corrected an oversight in my previous patch, where I failed to apply the escapeshellcmd to the mysql user, and applied escapeshellcmd to the new postgres section, which needs to be reviewed.
I didn't look at eval, and I don't know if the Drupal 7 part of _drush_bootstrap_drupal_configuration() in environment.inc needs to be urldecoded.
Comment #10
moshe weitzman commentedWhy do we url_decode() in one hunk and not in the other? I'd appreciate a review from someone else who is sufferring this problem
Comment #11
kdebaas commentedThis new patch is more logical and simpler. To clarify, there are two different bugs, as I understand it:
Comment #12
moshe weitzman commentedCommitted. thanks.