PDA

View Full Version : connecting to localhost


Aymen++
03-28-2004, 09:07 AM
when i tried to connect to local host using this code:

<?php
$conn=mysql_connect("localhost", "root", "elephant");
echo "$conn";
?>

this message appeared to me:
Warning: MySQL Connection Failed: Client does not support authentication
protocol requested by server; consider upgrading MySQL client in
C:\apache\htdocs\test\mysql.php on line 2

what is the problem?

firepages
03-28-2004, 05:37 PM
what version PHP & MySQL , also have you altered my.ini or my.cnf at all ?

Aymen++
03-29-2004, 09:51 AM
i have PHP Version 4.0.5, and MySQL 5.0.0, and i don't know what do u mean by:
have you altered my.ini or my.cnf at all ?

firepages
03-29-2004, 03:55 PM
php's mysql library uses the 3.23 client API & I am not sure if you can use that to access MySQL5 though I have never tried so thats a pure guess.

with a MySQL installation you should have a file called my.ini or my.cnf in your root or windows directory , this is a config file , without it MySQL will use config defaults , I do not know what these are in MySQL5.

Aymen++
03-30-2004, 03:29 AM
ok, can anyone know how to do it? or: what is the solution?