Jump to content
  • Advertisement
Sign in to follow this  
lack o comments

[web] php conflicting with MySQL

This topic is 4544 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I recently wrote a test application in PHP for connecting to a database. However, all I recieve is this error: Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:/*directorypath removed*/type.php on line 2 Client does not support authentication protocol requested by server; consider upgrading MySQL client I am assuming this code is outdated compared to the MySQL and PHP servers running and thus will not connect. I am using: PHP 4.4.2 MySQL 4.1 [Edited by - lack o comments on July 4, 2006 5:40:49 PM]

Share this post


Link to post
Share on other sites
Advertisement
I'm not 100% sure, but i think that you need php_mysqli extension (of php) to use mysql 4.1 and above with PHP. Unfortunately, last time i checked - php_mysqli extension was only availiable for PHP5 and above.

Share this post


Link to post
Share on other sites
I tried installing php_mysql.dll before and ended up reomving it when I had errors like this:

PHP Warning: Unknown(): Unable to load dynamic library 'C:directorynamereomved\php_mysql.dll' - The specified module could not be found. in Unknown on line 0

I had set the 'extension_dir' value in "php.ini" to point to the extension directory with php_mysql.dll and I placed libmysql.dll in the "System32" folder. As far as I know, these files should support PHP 4.12 through 5.1.4

Share this post


Link to post
Share on other sites
It sounds like a problem with MySQL's new password authentication (PASSWORD vs OLD_PASSWORD, etc.), probably caused with an older (php_mysql.dll) library 3.x or 4.0 trying to connect to a 4.1 or later server.

The mysql extension works, as long as it is built for 4.1. The mysqli extension would be more likely to work, since it has to be post 4.1.

One fix is to reset your password on the server to use the old format:

USE mysql;

UPDATE user
SET password=OLD_PASSWORD('blah')
WHERE user='me'
AND host='%';

FLUSH PRIVILEGES;

But I don't really recommend "fixing" the problem that way.

[Edited by - konForce on July 4, 2006 6:34:09 PM]

Share this post


Link to post
Share on other sites
You guys are correct. After some searching I've found that php_mysql.dll is for versions prior to 4.1. I need php_mysqli.dll The real issue now is that I can't find the page I downloaded it from (it also had php_mysqli.dll). I just saw it yesterday and now it's gone! If you happen to know where in that labyrinth of a website they are storing, please let me know ;)



[edit] Meh, nevermind. I'm still having the problem from my last post, except now there are two dll's it can't find. I know it is using the php.ini file in the WINDOWS directory because I've tested other settings.

[Edited by - lack o comments on July 4, 2006 7:10:39 PM]

Share this post


Link to post
Share on other sites
You don't need to use mysqli to connect to mysql 4.1 or later. You just need a mysql client library which is compatible with the new passwords (i.e. the PHP mysql extension built against a non-archaeological MySQL client lib).

Alternatively, use the "old passwords" trick as above - this is fine for a non-production environment and will effectively sidestep the issue without recompiling anything.

Mark

Share this post


Link to post
Share on other sites
Ok, that's fine. But it is not issue I am having.

Thr problem is that PHP will not load the these extensions properly. I have been pouring over dozens of forums during the night and non at all can seem to tell me what is wrong.

I am absolutely certain that everything is in the correct place and being referenced. But just to recap:

libmsql.dll -in System32 folder (also in "C:\Program Files\PHP")
php_mysql.dll -in the folder "C:\Program Files\PHP\ext"
php.ini -in "C:\Program Files\PHP"
PATH variable -contains "C:\Program Files\PHP" (so as to find php.ini)

php.ini contains directory reference to "C:\Program Files\PHP\ext"
and reference to load "php_mysql.dll"


And all I get is the same error:

PHP Warning: Unknown(): Unable to load dynamic library 'C:\Program Files\PHP\ext\php_mysql.dll' - The specified module could not be found. in Unknown on line 0


This is driving me insane (that and the fact that I haven't slept since Friday...) Anything clue at all would be just dandy right about now.

Share this post


Link to post
Share on other sites
I assume when doing a phpinfo(), it shows that the correct php.ini is being loaded. And that it shows that extension_dir is at the right spot?

If that is all correct, then you are missing some helper DLLs. A common one is "php5ts.dll" (or the equivalent for 4). Putting them in the C:\Windows or C:\Windows\System32 (I don't remember which is recommended) should take care of the problem. I don't know which DLL's the mysql extension relies on, but probably something like mysqlclient.dll.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!