weird problem with mysql and php

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
orange
Forum Newbie
Posts: 4
Joined: Tue Feb 08, 2005 4:27 am

weird problem with mysql and php

Post by orange »

this isn't exactly the same problem i've seen on other threads so i figure this deserves it's own thread :)

basically mysqli works but mysql and pear database functions don't work

i am using the following:
php 5.0.0
mysql 4.1.9
apache 2.0.52
windows xp

i set up apache mysql and php in accordance to the information i've found in books and online. heres a few of the key details that i know cause problems with others:

i put libmysql.dll and libmysqli.dll into system32

added to php.ini:
extension_dir = C:\php\ext
extension=php_mysqli.dll
extension=php_mysql.dll

i installed PEAR by running the go-pear program in command prompt and accepting all the defaults. i then ran the PEAR_ENV.reg file to add the registry settings.

at first this gave me problems with connecting to the database using php. it gave me this error: Client does not support authentication protocol requested
by server; consider upgrading MySQL client
i looked it up online and found that the most recent version of mysql uses a new type of password, and in order to use it with old versions of php, the password must be converted to the old format like this:
mysql> SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
the details are at this link: http://dev.mysql.com/doc/mysql/en/old-client.html

this does seem strange to me because as far as i know, php 5.0.0 should be compatable with this new password format.

when i did this change, the mysqli functions seem to work perfectly.

to test my configuration i used the 3 sample programs i found here:
http://www.cs.wcupa.edu/~rkline/apache-php-win.html

the first sample program uses the standard mysql interface. it fails with this error:
-->connect: Client does not support authentication protocol requested by server; consider upgrading MySQL client

the second sample program uses the mysqli interface and works perfectly

the third sample uses the PEAR db package and does nothing

so basically one out of three interfaces works for me, and i'd like to fix that. is there anything that could make the mysqli interface work but not the standard mysql interface? and did i miss a step on the PEAR installation somewhere? everything seemed to work well when i did it. do i need to use php 5.0.3 for this stuff to work or is 5.0.0 sufficient?

thanks a lot in advance :)
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Dunno if this helps you at all

http://dev.mysql.com/doc/mysql/en/old-client.html

Mark
orange
Forum Newbie
Posts: 4
Joined: Tue Feb 08, 2005 4:27 am

Post by orange »

i've seen that page before, it helped me get the mysqli interface working, but the standard mysql interface still gives the error

does php 5.0.3 have the same problem?
orange
Forum Newbie
Posts: 4
Joined: Tue Feb 08, 2005 4:27 am

Post by orange »

anybody got any ideas what i could have missed?
if not thats ok, i'm just using the mysqli interface for now, but i'm curious as to why the other two interfaces don't work
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

please allow 24 or more hours to pass before bumping a thread.
orange
Forum Newbie
Posts: 4
Joined: Tue Feb 08, 2005 4:27 am

Post by orange »

i waited 26 hours :D
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

oops.. my bad.
Post Reply