Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I just can't login to PhpMyAdmin anymore, it says bad logins. PHP works perfectly. Please help. Thank you.

2002 Cannot log in to the MySQL server
Log in

Connection for controluser as defined in your configuration failed.
share|improve this question

5 Answers 5

up vote 5 down vote accepted

It could be that your phpmyadmin configuration was somewhat "customised" and that it's no longer compatible with the way your MySQL server's configured. This should normally by handled properly when upgrading both.

If you don't understand your phpmyadmin configuration or didn't set it up yourself, some issues with phpmyadmin's configuration in Debian/Ubuntu can be overcome by purging and reinstalling the phpmyadmin package, or perhaps simply with sudo dpkg-reconfigure phpmyadmin.

share|improve this answer
Worked like a charm! thanks bro. –  Srinivas Gowda Jul 30 '12 at 8:32

You may reconfigure phpmyadmin, and reset MySQL password.

  1. Ctrl + Alt + T to launch terminal
  2. sudo dpkg-reconfigure phpmyadmin
  3. Connection method for MySQL database for phpmyadmin: unix socket
  4. Name of the database's administrative user: root
  5. Password of the database's administrative user: mysqlsamplepassword
  6. MySQL username for phpmyadmin: root
  7. MySQL database name for phpmyadmin: phpmyadmin
  8. Web server to reconfigure automatically: apache2
  9. ERROR 1045
  10. ignore
  11. sudo dpkg-reconfigure mysql-server-5.5
  12. New password for the MySQL "root" user: mysqlsamplepassword
  13. Repeat password for the MySQL "root" user: mysqlsamplepassword

Wish it helps!

Have a nice day!

share|improve this answer

If you upgraded mysql-server, you are probably suffering a broken package that has recently release in the precise repo.

share|improve this answer

In my case, resetting new password without white space characters worked for both phpmyadmin and mysql on Ubuntu 14.04 LTS.

It seems phpmyadmin could not use white space character in their password field and feels like dejavu on early days of Ubuntu 12.04 LTS which also could not log in to phpmyadmin due to having white space characters on mysql password. Do note that mysql is capable having white space characters in its password, though. :D

share|improve this answer

The problem was that the /etc/mysql/my.cnf was writable by another user than 'root'. So during the installation of mysql, the file was ignored and the installation didn't worked well.

A simple :

chmod 644 /etc/mysql/my.cnf
aptitude remove mysql-server
aptitude install mysql-server
aptitude install mysql-common

Did the job very well after all.

Aptitude is, in my opinion, much better than apt-get. It manage the dependencies way better than the other one and you have less chances to have problems.

share|improve this answer

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.