#1045 Cannot log in to the MySQL server message

total newbie here. I need to be able to use the WAMP Server 2.4, phpMyAdmin. I am getting the error message: #1045 Cannot log in to the MySQL server.
I had gone in through the MySQL console (taking a class). I followed the directions to successfully change the pw and now cannot get into the WAMP Server . . .
I have gone in and tried, successfully to change the pw. Still no luck.
At the “http://localhost/phpmyadmin/” screen, I have my user name as a default and then the hidden pw. I tried the pw I made and get the #1045 message.
I read in a couple forums that I needed to make changes to:

$cfg['Servers'][$i]['user'] = 'root'; //mysql username here
$cfg['Servers'][$i]['password'] = 'password'; //mysql password here

but I don’t have those lines as options which I can edit. All I have is this:

/* vim: set expandtab sw=4 ts=4 sts=4: */
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use setup/
 * All directives are explained in documentation in the doc/ folder
 * or at <http://docs.phpmyadmin.net/>.
 * @package PhpMyAdmin

 * This is needed for cookie based authentication to encrypt password in
 * cookie
$cfg['blowfish_secret'] = 'a8b7c6d'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

 * Servers configuration
$i = 0;

 * First server
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

 * phpMyAdmin configuration storage settings.

Should I add the above lines?
Or is there some other solution?
I am so lost here – no help yet from the instructor.
Thank you for all help.

Whew, found the answer: http://stackoverflow.com/a/17914582/2748102
I had changed the pw via the mySQL console.
I used “root” as the user name, not my logon name to my computer.

I did add this code to the config.inc.php:

$cfg[‘Servers’][$i][‘AllowNoPassword’] = true;
$cfg[‘Servers’][$i][‘user’] = ‘machine pw’; (but using “root” was what worked at the admin page there not the computer’s user/logon name).
$cfg[‘Servers’][$i][‘password’] = ‘xyz’;

I’m going to leave that as is for the moment. I don’t know if it was a combination of the tries or just one of the tactics.

Any thoughts???

Wow! Thank you SO much, Mariaoo! I was having the same problem. I am reading the Novice to Ninja book (chapter 2, p. 31) and have XAMPP installed. I clicked on the Admin button next to MySQL and got the login page. I had changed my password, and it appeared encrypted in the password field, but what was my username? I don’t know - I never created a username when I set this up. Then I tried using ‘root’ as suggested in your post above, and it worked.

I am SO PLEASED. I was stuck but now I can continue with the chapter! (:o)

Thanks for making my day.