Unable to connect to mysql at localhost[solved]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Unable to connect to mysql at localhost[solved]

Post 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)
Last edited by raghavan20 on Sun Jan 15, 2006 3:16 pm, edited 1 time in total.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post 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');
Post Reply