PDA

View Full Version : PHP MySQL connection error



dge_475
02 Apr 2006, 07:22 PM
Hi,

I thought I have successfully installed MySQL on my machine until this another error occur:

Error: 1251 SQLSTATE: 08004 (ER_NOT_SUPPORTED_AUTH_MODE)
Could not connect: Client does not support authentication protocol requested by server; consider upgrading MySQL client

whenever I tried to run this script from PHP:

<?php
$link = mysql_connect('localhost', 'root', 'nic');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

I hope somebody could help me on this, thnkx

cdwhalley.com
17 Apr 2006, 04:49 AM
I found this on the mysql docs:
link (http://dev.mysql.com/doc/refman/4.1/en/old-client.html)

If you have PHP 5 installed, it looks like you could try using mysqli_connect() as supposed to mysql_connect(), although this is what I'm getting from the docs page - I've never encountered this error myself :yawn: