I installed MySQL 8.0.16
on Windows 10 using the official online installer from here. I was able to install it successfully but on trying to log in as root I could not get past this error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I tried
Resetting the password.
Changing the authentication plugin using the installer.
Changing the authentication type using SQL.
Changing the way that MySQL Workbench sends passwords to the server.
logging in using the command line
un-installing and re-installing
Finally I installed MySQL 5.7.26 which works fine. I think there's a bug with version 8.0.16 on Windows 10. Anyone else having this issue?
Update
This question is not a duplicate of How to reset MySQL root password
. I always had the correct password but it was not working.
After multiple trials I think the problem is I had used a single quote in the password. But the installer didn't complain.
I just confirmed that if you use single quotes in your root password the installer will not complain but you won't be able to login with the password.
Even if you use the installer's Reconfigure
option to check your password the check will be OK. i.e. a green tick will show. But MySQL server will not accept it.
I was able to reset the root password using the official method specified here.
mysql-init.txt
with the content:ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpasswd';
cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
mysqld --defaults-file="C:\\ProgramData\\MySQL\\MySQL Server 8.0\\my.ini" --init-file=C:\\Users\\UserName\\mysql-init.txt --console
CTRL+C
mysql-init.txt
file.