Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

This question already has an answer here:

I have installed LAMP SERVER IN UBUNTU 13,04 .But could not login to phpmyadmin,showing the error message #1045 Cannot log in to the MySQL server, and Connection for controluser as defined in your configuration failed.

Please give me a solution

share|improve this question

marked as duplicate by Warren Hill, Eric Carvalho, Radu Rădeanu, aquaherd, Jorge Castro Jul 28 '13 at 14:17

This question was marked as an exact duplicate of an existing question.

Try this. Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo mysql -u root -p

This will prompt you for a new password. If that doesn't work try:

sudo /etc/init.d/mysql stop
sudo mysqld --skip-grant-tables &
mysql -u root mysql
UPDATE user SET Password=PASSWORD('New_Password') WHERE User='root'; FLUSH PRIVILEGES; exit;

Source:MySQL RM

share|improve this answer

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