469,647 Members | 1,688 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

usafshah
104 100+
Hi


I'm using linux with mysql , when i type mysql in terminal it says like:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

i'm logged in as root

but it works when i type mysql -u root -p and then type root password.
Feb 21 '07 #1
1 23852
Motoma
3,237 Expert 2GB
Hi


I'm using linux with mysql , when i type mysql in terminal it says like:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

i'm logged in as root

but it works when i type mysql -u root -p and then type root password.
There is a reason for this:
Typing mysql logs into your MySQL server using your username with no password. If your user account (i.e. the mysql account that has the same name as your linux user account) is password locked, then you will need to specify the -p command line argument so that you may enter your password.

You see, MySQL user accounts are not the same as Linux user accounts; there isn't usually a 1:1 mapping between them, and they can have different passwords.
Feb 21 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Morten Gulbrandsen | last post: by
reply views Thread by Morten Gulbrandsen | last post: by
2 posts views Thread by arsisthesis | last post: by
3 posts views Thread by Greg Noss | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.