Page 1 of 1

Unable to connect to mysql at localhost[solved]

Posted: Sun Jan 15, 2006 2:36 pm
by raghavan20
Local system is running with PHP 4.4.2, mysql 4 and apache 1.3 in Windows
php code:

Code: Select all

<?php
mysql_connect("localhost", "root", "rootPassword");
mysql_select_db("forum_db");
?>
reported errors...

Code: Select all

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in j:\apache\apache\htdocs\test\dbconnection.php on line 2

Warning: mysql_select_db(): Access denied for user 'ODBC'@'localhost' (using password: NO) in j:\apache\apache\htdocs\test\dbconnection.php on line 3

Warning: mysql_select_db(): A link to the server could not be established in j:\apache\apache\htdocs\test\dbconnection.php on line 3
available usernames in mysql.user

Code: Select all

mysql> select user,host,password from mysql.user;
+----------+-----------+-------------------------------------------+
| user     | host      | password                                  |
+----------+-----------+-------------------------------------------+
| root     | localhost | *9BC01A49104D6960C8C288548AD36884E0B580D8 |
| root     | %         | rootPassword                              |
| raghavan | localhost | *7ED9914DFC68CFA990B39A56635E9CBDE3E1F4E0 |
| francis  | localhost | *63DAA25989C7E01EB96570FA4DBE154711BEB361 |
| visitor  | localhost | *BE9CCED926640666CC59F47E0B9D3A98A2CB94C4 |
| dummy    | localhost |                                           |
+----------+-----------+-------------------------------------------+
6 rows in set (0.02 sec)

Posted: Sun Jan 15, 2006 3:10 pm
by Chris Corbyn
Search

Search

Search

Seriously... try searching the forum. You have no idea how many times I have answered this question, along with a load of other members.

Posted: Sun Jan 15, 2006 3:16 pm
by raghavan20
I am really sorry. I thought this is a very different problem so I posted but anyway found the answer after the search...thanks d11wtq

Code: Select all

SET PASSWORD FOR user@localhost = OLD_PASSWORD('password');