mysql_connect() w/4.3.8

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have been developing w/PHP & MySQL for several years on my RH 7.x dev

I recently decided to upgrade to Mandrake 10.1 and the latest version of PHP
& MySQL, 4.3.8 & 4.0.20 respectfully. After moving all my existing projects
over to the new server, I discovered that there's a problem with
mysql_connect() which generates the following error:

Warning: mysql_connect(): Access denied for user: 'webuser@localhost' (Using
password: YES) in /var/www/html/test.php on line 2
Could not connect: Access denied for user: 'webuser@localhost' (Using
password: YES)

I have double and triple checked my table entries in mysql.user and mysql.db
and everything is exactly like it was when running PHP 4.1.x and MySQL 3.x
(I forget the exact versions.)

I checked, but couldn't find a specific solution to this problem.
Can someone clue me in?

Thanks in advance!

Re: mysql_connect() w/4.3.8

Quoted text here. Click to load it

At some point, like around MySQL 4.0.something, MySQL started using
a new form of password hash.  If you change your password, you
probably get the new hash.  Old-style clients (either the libmysqlclient
library or the one built into PHP) cannot log into accounts with
new-style passwords.  Look at the length of the password string in
the user table.  16 is old-style, 41 is new-style and starts with
an asterisk, and I think there was an intermediate style of a
different length.

Modern PHP versions need the libmysqlclient library installed.
Make sure that this is about the same MySQL version as your server.

Then again, maybe you just have the username/password incorrect.
Did you "flush privileges" after making changes in the privilege

                        Gordon L. Burditt

Re: mysql_connect() w/4.3.8

Quoted text here. Click to load it
Quoted text here. Click to load it


Thanks for your reply.

As you suggested, I checked out the password hashing issue (that's with
MySQL 4.1 and I'm running 4.0.20) and PHP library versions (they're all
current for version 4.3.8). I then decided to remove and add the user
account YET AGAIN only this time using GRANT instead of INSERT and boom,
problem solved. It must have had something to do with FLUSH PRIVILEGES
(which is unnecessary with GRANT.)

Anyway, thanks again.

Site Timeline