Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How should I diagnose ERROR 1045 during MySQL installation?

The server runs on Ubuntu 9.10 64b.

I have installed mysql-server from source. The installation has completed successfully but when I run the mysql command in a terminal, I get following error:

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

What does that mean ? How do i rectify this error?

share|improve this question

marked as duplicate by Scott Pack, Ben Pilbrow, Iain, coredump, voretaq7 Apr 4 '11 at 5:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You need to set a password before you can use it:

mysqladmin -u root password mysecret

After that, you can login with

mysql -u root -p
share|improve this answer
yeah..this works! – Arihant Apr 3 '11 at 14:25
i found one more solution :… This is also working fine. – Arihant Apr 3 '11 at 14:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.