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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

danielc’s picture

Title: Change default $db_url to something unique and informative » Make default $db_url informative and unique
Dries’s picture

This is clearly documented in the text above the setting. Also, the modifications are not consistent with the example in the documentation.

danielc’s picture

I'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?

danielc’s picture

If 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.

danielc’s picture

This 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.

danielc’s picture

Can this please be applied to HEAD and 4-6?

Morbus Iff’s picture

-1. No user knows, or is told, what DBMS is.

danielc’s picture

If "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.

danielc’s picture

This patch changes the default $db_url in settings.php to match the one already in INSTALL.txt: mysql://userid:password@localhost/database

danielc’s picture

Uploading the patch helps, eh?

Morbus Iff’s picture

+1 from me.

Dries’s picture

Please update the phpdoc comments in settings.php as well.

danielc’s picture

The patch (settings.dburl.per.install2.diff, associated with comment 10) does update the docblock.

Dries’s picture

It doens't update all occurences; search for 'db_name'.

danielc’s picture

FileSize
1.26 KB

Ah. Good catch.

Dries’s picture

Committed to HEAD and DRUPAL-4-6. Renamed 'userid' to 'username' though.

Anonymous’s picture