ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N O)
I've tried EVERYTHING, I've read through pages of answers and no-one seems to know the right one.
When i try to log into my DB i just get the above error, I havent set a password or anything.
Can't log into MySQL at all now, don't understand.
Thanks for your help in advance
use the -p
option. (Tells mysql that you want to provide a password when logging in.)
$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
$ mysql -u root -p
Enter password:
If that doesn't work, try B.5.4.1. How to Reset the Root Password from the MySQL Reference Manual.
$ mysql -u root -p{you_password} {db_name}
just remove '{}' from the string.
In the services.msc check if mysql is running as local system or network system. By default, it should be network system , change that to local system and restart the service.
来源:https://stackoverflow.com/questions/2912761/beginner-mysql-error-access-denied