Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I have a mysql database installed on my computer running Ubuntu 10.04. Whenever i try to login to it using the following command it gives me an error.

mysql --user=username --password=password
ERROR 1045 (28000): Access denied for user 'username'@'localhost' (using password: YES)

If i use phpmyadmin, i still can't login to the database.I installed the GUI thingy, mysql admin and i can use that to login and run queries. Also if i write a php/python script to connect to the DB, they do connect and make the required changes. What might be the problem and how do i go about fixing it ? My earlier installation of karmic didn't give me any such problems.

share|improve this question
up vote 1 down vote accepted

The syntax should be

mysql -u [USER] -p

Replace [USER] with the username you are using and you will be prompted for your password.

share|improve this answer
That worked .. thanks. – tapan Jun 20 '10 at 12:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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