Im trying to learn php+mysql+apache
and I've just installed
Apache 2, mysql 4.1.7 and php 4.3.9
and got apache and php working and mysql running as a service under WinXP
and tried running the following code:
<pre>
<?php
//connect to MySQL
$host = "localhost";
$user = "root";
$pass = "mysql";
$connect = mysql_connect($host, $user, $pass) or
die("Unable to connect to " . $host . " using username " . $user . ".");
</pre>
but the following error pops up:
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Apache2\htdocs\create_movie.php on line 8
Unable to connect to localhost using username root.
Can anyone help me out here?
btw i did a status \T and got this:
Connection id: 5
Current database: mysql
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 4.1.7
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
TCP port: 3306
Uptime: 42 min 33 sec
I guess i was too lazy to search first, well i just did a search here and got the answer from shareaweb
from his post here:
http://www.phpbuilder.com/board/showthread.php?s=&threadid=10264691&highlight=mysql+and+connection+and+resolved
just read up on
http://dev.mysql.com/doc/mysql/en/Password_hashing.html
and got things going.