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.

I have a root user in mysql-server on the Ubuntu server. I am unable to login to phpmyadmin with the root user and password. I was trying to find the configuration file but could not locate it. Help would be appreciated.

Thanks in advance

share|improve this question
Did you ever find the answer to this problem? I'm having problems myself as well. –  chrisjlee Oct 10 '11 at 2:03

4 Answers 4

By "rootuser" you mean the MySQL root user, not the system root user, right?

During the installation of mysql-server, the MySQL root account is created and its password is stored in /etc/mysql/debian.cnf.

The configuration files of phpMyAdmin are stored in /etc/phpmyadmin.

share|improve this answer
Yes, I mean MySQL root user and not the system root user.I found the config file. Why is phpmyadmin not allowing to log me in with the mysql user login –  user14010 Apr 10 '11 at 19:30
@user14010: Does the command-line mysql version work? E.g. mysql -hlocalhost -uroot -p ? –  Lekensteyn Apr 10 '11 at 20:57
Yes it works. I am able to login to mysql through command line version but not with phpmyadmin. The reason why I am trying to use phpmyadmin is I have a sql script when I am trying to import it using the commandline mysql it is creating problems with the foreignkeys resulting in error 121. When I import the same script uing phpmyadmin it succesfully creates the tables –  user14010 Apr 10 '11 at 21:11
@user14010: What error message did you get? I've updated my answer with the location of the PMA configuration files. –  Lekensteyn Apr 11 '11 at 12:50

Might for some reason the AllowRoot option be set to False? See the documentation.

share|improve this answer

You have to reconfigure phpmyadmin, reset MySQL password.

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

Wish it helps!

Have a nice day!

share|improve this answer

I recently came across a very similar issue with Ubuntu 12.04. I just couldn't seem to login with root & no password. I set the AllowNoPassword setting to TRUE in the config. Later I found out that I was editing the wrong config.inc.php file to add the AllowNoPassword setting.


I believe the first is the debian local config file, which will override the usr version.

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.