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.