“Connection for controluser as defined in your configuration failed” It’s one of those small, annoying messages that appear out of the way on your screen, but still catches your eye once in a while especially when you’re deep in thought about how to building a multi-join query in the SQL tab of phpmyadmin.
Well, it annoyed me today so much that I finally decided to do something about it and finally take a look. I opened up the PHPMyAdmin config file located at /etc/phpmyadmin/config-db.php on Ubuntu Maverick Meerkat. There’s a default username and password in $dbuser and $dbpass variables.
Now my knee jerk reaction to this would have been “no problem I’ll just change that to my root username and password.” which will work by the way, but I decided against it since the control user for PHPMyAdmin did not really need to have access to all the other databases in my local cluster.
I decided instead to create a new user in MySQL, granted it with all privileges to `phpmyadmin`.* and gave it a strong password.
#mysql -umyrootuser -p
mysql> GRANT ALL PRIVILEGES on `phpmyadmin`.* to ‘somephpmyadminuser’@'localhost’ IDENTIFIED BY ‘somestrongpassword’;
Next, I updated the file in /etc/phpmyadmin/config-db.php to reflect the details of the new user I created. I opened it up with vim as a super user in ubuntu.
Then I updated the file:
After saving that file, PHPMyAdmin will no longer report that the “Connection for controluser as defined in your configuration failed”. Because it doesn’t fail anymore, your controluser as defined in your configuration file now has access to the phpmyadmin database.