I can connect to my mysql db using php without a password fine. However, when I add a password in phpmyadmin I can no longer connect. I consistently get the error of:
"Could not connect: Access denied for user 'admin'@'localhost' (using password: YES)"
I’ve tried using both settings of MySQL password 4.0 and 4.1+ with the same results.
mysql_connect ("127.0.0.1", "admin", "password") or die('Could not connect: ' . mysql_error());;
mysql_select_db ("datatable");
Does anyone have an idea of what may be going on here?
EDIT: I can access it if I turn off the password. There seems to be some misunderstanding
This might help
steps-
it will ask you for a pw – just hit the return since you don’t have one yet (next time you go to the console you’ll need to enter the new pw that you’r entering here).
type the following:
UPDATE mysql.user
SET Password=PASSWORD(“xxxxxx”)
WHERE User=”root”;
(where xxxxxx is the password you entered in the previous step).
Now type:
FLUSH PRIVILEGES;
go to your WAMP or MAMP folder, find the APPS folder, and than click on your PHPMYADMIN folder ( e.g my folder called phpmyadmin2.11.6 ) and find the config.inc.php
open config.inc.php with wordpad and find the following text:
$cfg['Servers'][$i]['password'] = '';now add the password that you used in step number 3 like this :
$cfg['Servers'][$i]['password'] = 'yourPasswordHere';You should be all set now!
Source – http://www.knowledgesutra.com/discuss/tsilti-php-myadmin-access-mysql-database.html