This is the error I am getting when I run my php file. I have searched over the network and found some tricks to solve the error but all in vain. some of them suggested to change the username and password for the localhost server and some advised to change only the password.
I tried both and ended up crashing phpmyadmin panel. The other user suggested to change the ports of the running servers. I specifically use mamp as I am using mac os.
I tried to change the ports but nothing worked. Afterwards I looked upon many blogs and web-articles but they also proved to be the same. One site advised to change the mamp config by using the terminal application.
When I tried to change the mysql password nothing appeared on the screen and when I approached for changing the phpmyadmin password it reflected error which said that no such directory is found.
I reinstalled mamp several times but no effect.
Please answer as soon as possible because I am stuck here and no one seems to act as a savior for me.
Go to the config.inc.php file
In the file, search for the line
$cfg['Servers'][$i]['password']
and change it to
$cfg['Servers'][$i]['password']='root'
Hope it helps