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 database.
I suspect that it's because 'database' does not look as something to be changed. So I've changed it to dbname.

Comments

chx’s picture

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

killes@www.drop.org’s picture

dumb users should use civicspace installer...

morbus iff’s picture

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

Cvbge’s picture

StatusFileSize
new1.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.

morbus iff’s picture

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.

kbahey’s picture

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

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";
Thomas Ilsche’s picture

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.

robertdouglass’s picture

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

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.

Cvbge’s picture

First, I think array approach is more natural then the url-like syntax.

Second, I agree that drupal users need not to be programmers. You are removing usefull features and options to make drupal easier (for the sake of "dumb" users!), but you want to keep more complicated db_url

Third, I don't think we must "educate" users, not that teaching them url-like syntax is benefitting them. They should think, not remember some foo://bar:bah@blah/blop syntax

Fourth, with array syntax it'd be possibile to have multiple databases support, I think there was a request for it, can't find it now.

Fifth, this is drupal.org, not civicspace.org. How come you ask people to use CS?

robertdouglass’s picture

I hadn't considered the multiple database support aspect. Thanks for pointing that out. If that feature can be supported and this is the path, then I'm a convert.

As for CivicSpace, I recommend to anyone who is interested in Drupal that they check out CivicSpace. I think it is a fantastic product and doesn't lead to people being any less involved with Drupal, but does lead to them being more satisfied with it.

-R

Cvbge’s picture

jo1ene’s picture

I'm not sure what the point is in changing this. The next statement in the install file explains what "database" is. If we want to go CMS for Dummies, we should work up a web-based installation interaface - and then deal with those headaches.

venkat-rk’s picture

I recollect that Wordpress follows Khalid's approach. And, we know it is famous for its five-minute install.

Of couse, with command line, I find I can also install drupal in about the same time. But, we are talking about inexperienced users...

kbahey’s picture

Here is more reason for what I suggested in #6 above.

This user is confused with the DB URL and thinks the last fields is a subdirectory.

This stuff is not evident for people, and the installer will not happen for 4.7. Even if the installer is there, it is clearer to have discrete fields, and we join them into a db url.

morbus iff’s picture

Status: Needs review » Fixed

The core of this issue ('database' to 'dbname') has been addressed via the patch from http://drupal.org/node/25792.

Anonymous’s picture

Status: Fixed » Closed (fixed)