[drupal-devel] [bug] Change 'database' to 'dbname' in db_url and INSTALL.txt

robertDouglass drupal-devel at drupal.org
Sun Aug 21 21:17:35 UTC 2005

Issue status update for 
Post a follow up: 

 Project:      Drupal
 Version:      cvs
 Component:    base system
 Category:     bug reports
 Priority:     minor
 Assigned to:  Anonymous
 Reported by:  Cvbge
 Updated by:   robertDouglass
 Status:       patch (code needs review)

-1 to having the database type be set in an array.

I'm with Morbus. This is what database connection strings look like.
The instructions are very clear, and if we change database to db_name,
I doubt we can do any better. I don't think setting three variables is
easier. I really don't think making a database type variable is a good

If people really can't put the values into the db connection string
they should be told to use CivicSpace. In fact, I think all new Drupal
users should be told to use CivicSpace.


Previous comments:

Sun, 21 Aug 2005 17:02:34 +0000 : Cvbge

Attachment: http://drupal.org/files/issues/dbname.diff (1.68 KB)

I've seen several times that users forgot to change the 'database' in
$db_url to their real database name when installing drupal. They have
done all other steps, set up db_url but forgot only to change the
I suspect that it's because 'database' does not look as something to be
changed. So I've changed it to dbname.


Sun, 21 Aug 2005 17:14:57 +0000 : chx

Attachment: http://drupal.org/files/issues/this_patch_is_for_dumb_users_who_can_not_read_a_proper_install_text.patch (700 bytes)

Well,I think INSTALL.txt is fine especially because users do not read
it, if they would, then they would have no problem. Now, let's see this
version for settings.php


Sun, 21 Aug 2005 17:20:31 +0000 : killes at www.drop.org

dumb users should use civicspace installer...


Sun, 21 Aug 2005 17:31:17 +0000 : Morbus Iff

Chx's path goes a little too far. I'm ambivalent about this one,
honestly, but if it does get switched, at least use "db_name" and not
"dbname". The "db_" follows the previously established "standard" of


Sun, 21 Aug 2005 18:15:34 +0000 : Cvbge

Attachment: http://drupal.org/files/issues/dbname2.diff (1.71 KB)

This patch is not for users good, but for us. The so called "dumb" users
come to -support and waste *our* time.

Attached a patch with 'database_name' version (which is IMO better then
db_name or dbname).

But I think we should change db_url syntax and use array-like settings.
That would be clearer, easier for user, fix http://drupal.org/node/26836
and maybe fix problems with special characters in password. Sorry, I'm
not going to make a patch for it, I have other things to do.


Sun, 21 Aug 2005 19:51:05 +0000 : Morbus Iff

I'm not fond of an array approach. The syntax we're currently using is
the "normal" way of indicating database connection information for most
database interfaces - I'd rather teach users the "normal" way of marking
up their information, such that they can use it in other applications,
than teach them PHP arrays.


Sun, 21 Aug 2005 20:51:26 +0000 : kbahey

Users are the ones who edit this files, and they are often not
developers. What is obvious for us developers, is totally foreign to

I prefer an atomic approach to this: a variable for each component, and
we combine them internally to form the database URL.

There is even no need for an array, since users can be confused by the
=> syntax.

// Database type, either 'mysql' or 'pgsql'
$db_type = 'mysql';
// Database name
$db_name = 'drupal';
// Database user name
$db_user = 'drupal';
// Database password
$db_password = 'secretthing';
// Database host name, normally 'localhost'
$db_host = 'localhost';
// Database port, normally leave it as it is
$db_port = '';

We then combine that to:
$db_url = "$db_type://$db_name:$db_password@db_host/db_name";


Sun, 21 Aug 2005 21:07:11 +0000 : Thomas Ilsche

I would prefer arrays from anything else. The combination to some URL
that anyway needs string parsing afterwards.

$db['type'] = 'mysql';   // Database type, either 'mysql' or 'pgsql'

And from the users point of view, I consider this really easy and
anyone that configured phpMyAdmin before will also be used to this.

More information about the drupal-devel mailing list