Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Beginner MYSQL Error - Access Denied

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

like image 608
WANNABE Avatar asked May 07 '26 22:05

WANNABE


1 Answers

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.

like image 154
aioobe Avatar answered May 09 '26 14:05

aioobe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!