Beginner MYSQL Error - Access Denied

陌路散爱 提交于 2019-12-07 13:30:27

问题


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


回答1:


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.




回答2:


$ mysql -u root -p{you_password} {db_name}

just remove '{}' from the string.




回答3:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!