Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error 1045 (28000) access denied for user 'root'@'localhost' (using password: YES)

Please forgive me for being a complete beginner:

I am trying to log into my very first mySQL database that I installed using easyPHP on my windows machine, using the cmd line. I am going to the \mysql\bin and entering the command:

mysql -u root

in order to log in, but I am getting the following message:

error 1045 (28000) access denied for user 'root'@'localhost' (using password: YES)

Why is it using the password "YES"? Shouldn't there be no password at all? Do I need to restart mySQL or something? If so, how do I do that? If it's relevant, I did try to create the database using phpmyadmin, but had a few problems entering columns and decided I'd be better off working from the command line so I could learn all the commands as I went along.

Please keep in mind that this is my first time ever trying to work with a database, so be kind to me!

like image 319
mavix Avatar asked Feb 21 '12 17:02

mavix


1 Answers

To have mysql asking you for a password, you also need to specify the -p-option:

mysql -u root -p
like image 147
feeela Avatar answered Oct 19 '22 18:10

feeela