Problems with mysql_connect - insisting on nobody@localhost without a password

vidyak - July 24, 2005 - 18:26

Hi all
I am installing 4.6.2 on a linux server on 4.23.58 and php 4.3.2 .(I know, not recommended)
For some daft reason, the database.mysql.inc is not passing any other user name,host or password to the mysql_connect statement other than nobody@localhost without a password.

When I change the mysql database user - nobody. and remove the password, the site loads beautifully and I could do wonderful things.

Please for some help in understanding how the db_url is supposed to work,
Thanks

You did change settings.php?

SamAMac - July 24, 2005 - 20:29

From your last comment, I'm assuming that you did change db_url in settings.php.

It should be mysql://user:password@localhost/database_name.

If that is correct, then I would crack open database.mysql.inc and insert these lines before the call to mysql_connect():

print $url['host'];
print $url['user'];
print $url['pass'];

Then load a page and see what it spits out. If the right host, user and password are spit out, then the problem would seem to lie in your PHP installation. Otherwise, try a print $url; before the call to parse_url and see what it looks like. If it's wrong, then start working backwards, to database.inc, and see where the problem lies.

Yep.. I changed settings.php

vidyak - July 25, 2005 - 14:11

Hi,
Yes, I have the correct db_url in settings.php. I edited the database.mysql.inc file and hard coded the mysql_connect with my username, password and host. And still, it will not connect, instead
I get the error that Access denied for nobody@localhost using password (No).
I then change my database, and remove the password for the 'nobody@localhost' and .. everything works fine! In fact , it as though we are ignoring the mysql_connect statement or something like that!
Thanks

password

sepeck - July 25, 2005 - 16:18

are you using non alpha numeric characters in your password? It doesn't seem to like that.

-sp
---------
Test sites and good habits: Drupal Best Practices Guide.
Back Mountain

Regular password

vidyak - July 25, 2005 - 18:11

Hi, no.. my password has regular alphanumeric characters.. nothing different.

Thanks

Safe mode is enabled..

vidyak - July 26, 2005 - 20:09

I discovered that since safe_mode is on in the php.ini, mysql_connect ignores all parameters passed to it and connects to the database, using the php user and without a password.

I wonder if this should go in the Install .txt?

 
 

Drupal is a registered trademark of Dries Buytaert.