Home > Archive > PHP Programming > December 2004 > mysql_connect() w/4.3.8
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
mysql_connect() w/4.3.8
|
|
| Bosconian 2004-12-25, 3:55 am |
| I have been developing w/PHP & MySQL for several years on my RH 7.x dev
server.
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 php.net, but couldn't find a specific solution to this problem.
Can someone clue me in?
Thanks in advance!
| |
| Gordon Burditt 2004-12-25, 3:55 am |
| >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 php.net, but couldn't find a specific solution to this problem.
>Can someone clue me in?
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
tables?
Gordon L. Burditt
| |
| Bosconian 2004-12-25, 8:55 am |
| "Gordon Burditt" <gordonb.ybzrs@burditt.org> wrote in message
news:cqj1a5$2sj@library2.airnews.net...
PHP[color=darkred]
projects[color=darkred]
(Using[color=darkred]
mysql.db[color=darkred]
3.x[color=darkred]
>
> 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
> tables?
>
>
> Gordon L. Burditt
Gordon,
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.
|
|
|
|
|