Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, the default $db_url in /drupal/sites/default/settings.php is
"mysql://drupal:drupal@localhost/drupal". It would be helpful for end users if its contents were more descriptive, such as "mysql://user:password@localhost/databasename".
A side benefit of this change is helping automated installation scripts determine if the settings in the /drupal/sites/default/ are meant to be used or not. This is because the existing db_url could possibly be used in real life while the proposed text is very unlikely to be used.
Comment | File | Size | Author |
---|---|---|---|
#15 | dburl.per.install.diff | 1.26 KB | danielc |
#10 | settings.dburl.per.install2.diff | 822 bytes | danielc |
#5 | settings.dburl.per.install.diff | 1.68 KB | danielc |
settings.dburl.diff | 581 bytes | danielc | |
Comments
Comment #1
danielc CreditAttribution: danielc commentedComment #2
Dries CreditAttribution: Dries commentedThis is clearly documented in the text above the setting. Also, the modifications are not consistent with the example in the documentation.
Comment #3
danielc CreditAttribution: danielc commentedI'm concerned that some users could actually use the "drupal" for the db, user and password. That would trip up any bulid scripts that want to ignore settings in sites/default/settings.php ONLY if they're not really being used. Plus using those as db/user/pw sucks for security.
How about using the sample URL from the docblock as the default $db_url and I submit a patch to update the documentation with the new information?
Comment #4
danielc CreditAttribution: danielc commentedIf the default $db_url does get changed, here is a list of Handbook pages that make reference to $db_url:
http://drupal.org/node/260
http://drupal.org/node/17430
http://drupal.org/node/1357
http://drupal.org/node/495
http://drupal.org/node/5438
http://drupal.org/node/9407
http://drupal.org/node/3854
This last page makes mention of includes/conf.php instead of sites/default/settings.php
Plus INSTALL.txt would need to be updated.
Comment #5
danielc CreditAttribution: danielc commentedThis patch unifies the format of the default $db_url. It uses the format found in INSTALL.txt, plus it clarifies the ability to change the DMBS.
Comment #6
danielc CreditAttribution: danielc commentedCan this please be applied to HEAD and 4-6?
Comment #7
Morbus Iff-1. No user knows, or is told, what DBMS is.
Comment #8
danielc CreditAttribution: danielc commentedIf "dbms" is the concern, we can either explain what it means or can leave the default as "mysql." But, please, the default $db_url in settings.php needs to be something else. Tell me what you want it to be and I'll make a patch with it.
Comment #9
danielc CreditAttribution: danielc commentedThis patch changes the default $db_url in settings.php to match the one already in INSTALL.txt: mysql://userid:password@localhost/database
Comment #10
danielc CreditAttribution: danielc commentedUploading the patch helps, eh?
Comment #11
Morbus Iff+1 from me.
Comment #12
Dries CreditAttribution: Dries commentedPlease update the phpdoc comments in settings.php as well.
Comment #13
danielc CreditAttribution: danielc commentedThe patch (settings.dburl.per.install2.diff, associated with comment 10) does update the docblock.
Comment #14
Dries CreditAttribution: Dries commentedIt doens't update all occurences; search for 'db_name'.
Comment #15
danielc CreditAttribution: danielc commentedAh. Good catch.
Comment #16
Dries CreditAttribution: Dries commentedCommitted to HEAD and DRUPAL-4-6. Renamed 'userid' to 'username' though.
Comment #17
(not verified) CreditAttribution: commented