Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

1 Answer 1

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
add comment

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