This might seem redundant but I was unable to find a correct solution.
I was unable to login to mysql using the mysql console.It is asking for a password and I have
I have encountered similar mistakes, and later found that my password is wrong.
after installation i started wamp and i was asked for user and pass which were already set on default (user:admin pass: dots), and that was wrong with a message from your topic. Than, i just entered:
Username: root Password: (leave it empty)
and it worked for me!!
I first changed the root password running mysql at a prompt with
mysql -u root -p
Update password:
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
Edited line in the file config.inc.php
with the new root password:
$cfg['Servers'][$i]['password'] = 'MyNewPass'
Stop and re-start mysql service (in Windows: mysql_stop.bat
/mysql_start.bat
)
and got phpMyAdmin to work!
EDIT 2017: for MySQL≥5.7 use authentication_string
in place of Password
(see this answer):
UPDATE mysql.user SET authentication_string=PASSWORD('MyNewPass') WHERE User='root';
Go to C:\xampp\phpMyAdmin
Edit the config.inc.php
file
Replace $cfg['Servers'][$i]['auth_type'] = 'config';
by
$cfg['Servers'][$i]['auth_type'] = 'cookie';
For now on the PHPMyAdmin
will ask you for your password, no more error.
In the my.ini file in C:\xampp\mysql\bin, add the following line after the [mysqld]
command under #Mysql Server
:
skip-grant-tables
This should remove the error 1045.