I almost have the multisite installation working. I have managed to create the symlink needed to install Drupal on my add-on domain. However, I get a failure at the install screen that the database could not be accessed using the password YES. The database path, name and password are correctly set in all the settings.php files for all domains. Any ideas?

When I copied and edited the default settings.php file Drupal made for the installation of the first domain, I noticed that it encrypted the password for the $db_url. I tried to both copy this encrypted string of characters into the add-on domain's php file and I typed it out literally, ie. d0gg13! (no worries, not the real pw). Drupal did not like either method. According to its failure message, it tries to use the password YES.

BTW, I am using multiple databases with the same single user assigned to each database.

Thanks in advance for the help.

Comments

cog.rusty’s picture

Drupal does not encrypt that password neither expects it to be encrypted.

Have you granted your database user privileges for the new database?

Or, if you have granted wildcard privileges for all your drupal database names, does the name of your new database conform with that?

Utah_Jackson’s picture

Yes and yes.

david bluecame’s picture

Dear cog.rusty

I'm sorry but I have to disagree. The database password that you put in the settings.php file can and should be encrypted. I will explain how I do it:

1) Add a super-user in your mysql database, say for example:
user: john
password: johnny (don't do this in real life ;-)

I'm not explaining how to add super-users to the mysql database as there are several methods depending on the server used.

2) Install apache in your computer. It's necessary because after installing it you will have the htpasswd command.

3) Run the following command:

htpasswd -nb john johnny

4) You will see in the result something similar to:

john:0PBJKwsnoEbQI

5) In settings.php you have to complete the line with the mysql database using these user and encrypted password. I'm going to assume that the database is called "mydatabase"

$db_url = 'mysql://john:0PBJKwsnoEbQI@localhost/mydatabase';

Now, you should be able to run the site. Just remember to change the file permissions to restrict anyone but you to access it.

There is something that I don't still understand: when using a complex and stronger password like "JohNnY-HowAreYou-1" it does not work even using a non-encrypted password. Does anybody know why is that or it only happens to me (using Drupal 6.15 and 6.16)???

Best regards.

David Bluecame.

cog.rusty’s picture

Let's assume that

$db_url = 'mysql://john:0PBJKwsnoEbQI@localhost/mydatabase';

can really connect you to the database. Then, john:0PBJKwsnoEbQI is a valid database username:password which, again, is stored in plain text in settings.php.

So, make sure that the database user is no superuser but just a luser who can access only this one database.

david bluecame’s picture

Dear cog.rusty

I've been saying nonsense with my previous post. In my tests I have made a stupid mistake, editing the default.settings.php instead of the actual settings.php C:-))

I will continue investigating this as Fantastico seems to somehow encrypt the password, but I cannot do it using htpasswd.

You were right: the password cannot be encrypted in settings.php

Sorry for making you lose time in this and best regards.

David Bluecame.

cog.rusty’s picture

I don't know Fantastico, but my guess is that they are using something that looks like an encrypted password but in reality it is a random generated password string for the database user.

alexbk66-’s picture

Yeah, when I used Fantastico to install Drupal first time - it did encrypt the password. And Drupal did work.

Now I install Drupal using install.php - and the password isn't encrypted anymore.

Any suggestions?

I think it's an important security issue for every Drupal user!