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.

link|improve this question

61% accept rate
feedback

1 Answer

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.

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

Your Answer

 
or
required, but never shown

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