php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42546 Php connect to mySQL
Submitted: 2007-09-04 18:13 UTC Modified: 2007-09-08 19:16 UTC
From: hwu475 at yahoo dot com Assigned:
Status: Not a bug Package: *Configuration Issues
PHP Version: 4.4.7 OS: Win XP home
Private report: No CVE-ID: None
 [2007-09-04 18:13 UTC] hwu475 at yahoo dot com
Description:
------------
Note:

I am not able to connect php to mySQL and please see below error messages. If  I am not going to change versions of my servers, can I connect (using my ?php? scripts) to mySQl databases?

I am current using:

Apache 1.3.37
MySQL 4.1.22
Php 4.4.7


Thank you,

Henry from Oregon USA



Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\program files\apache group\apache\htdocs\temp_con.php on line 3

error connectingClient does not support authentication protocol requested by server; consider upgrading MySQL client




Reproduce code:
---------------
Here are my php scripts (db_config.php,   temp_con.php) :

db_config.php

<?php
$db_host = "localhost";
$db_user = "root";
$db_password = "123123";
$db_name = "webq";
?>

temp_con.php

<?php
require($_server["DOCUMENT_ROOT"]."db_config.php");
$connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting");
print "connection made";
?>

Expected result:
----------------
"connection made"

Actual result:
--------------
error (see above)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-08 19:11 UTC] hholzgra@php.net
see http://dev.mysql.com/doc/refman/4.1/en/password-hashing.html

you can stick with the versions you are running, but you need
to recompile php against the client libs from the installed
MySQL version instead of using the bundled library then:

  configure --with-mysql=/path/to/mysql
 [2007-09-08 19:16 UTC] hholzgra@php.net
Or you can follow the instructions how to set backwards compatible mysql passwords as documented in the manual page quoted above.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 20:01:29 2024 UTC