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?
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
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
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
Hi, no.. my password has regular alphanumeric characters.. nothing different.
Thanks
Safe mode is enabled..
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?