By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,914 Members | 1,100 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,914 IT Pros & Developers. It's quick & easy.

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

usafshah
100+
P: 104
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
Share this Question
Share on Google+
1 Reply


Motoma
Expert 2.5K+
P: 3,235
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.