phpMyAdmin: CONNECTION FOR CONTROLUSER AS DEFINED IN YOUR CONFIGURATION FAILED
What is the cause of this error?
First, you have to make sure that your MySQL server is up and running. Since this is trivial and easy to determine, it is most likely not the cause of the error (also, other errors along this one are displayed in that case).
Second, have you recently changed your MySQL Server root password? If answer is YES, then this is the cause of the error / warning inside phpMyAdmin console. To fix the problem, simply edit your phpMyAdmin’s config-db.php file and setup the proper database password:
In Linux-based servers the file is usually located in:
/etc/phpmyadmin/config-db.php
or:
/etc/phpMyAdmin/config-db.php
Notice the camelCase difference in the above path names: /phpmyadmin/ and /phpMyAdmin/ are two different directories under Linux operating systems! Under Windows, directory names are not case-sensitive, so above paths will be the one and only (same) directory.
EXAMPLE CONTENT:
$dbuser='root';
$dbpass='password'; // set current password between quotes ' '
$basepath='';
$dbname='phpmyadmin';
$dbserver='';
$dbport='';
$dbtype='mysql';
14 Comments
Add Your CommentI am using window 8. I did’t find config-db.php file in phpmyadmin folder.
June 20th, 2016Hi, this tutorial is for Linux-based live servers, exclusively. On Windows, you haven’t specified which server environment do you use, possibly IIS or some WAMP/XAMPP dev stack. For example, in XAMPP it is located in /path/to/xampp/phpMyAdmin/config.inc.php. In another words, database credentials are integrated into main phpMyAdmin configuration file:
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Maybe it is the same in your case, look for phpMyAdmin installation directory first and check main config file.
June 20th, 2016Apparently in my ubuntu 14.4 it shows “bash: cd: /etc/phpmyadmin: No such file or directory”
August 21st, 2016Under Linux / Ubuntu, phpMyAdmin application itself is/should be [usually] installed in:
/usr/share/phpmyadmin/
First, check that you actually have it installed there already.
Now, /etc/phpmyadmin/ was just an example, if you installed it using official repository with command:
apt-get install phpmyadmin
Then, configuration and security part should be in /etc/phpmyadmin/ directory.
Type commands in terminal:
user@server:~# cd /etc
user@server:/etc# dir
To list all subdirs in your /etc/ directory and see if there is some other similar folder.
For example:
phpMyAdmin [notice the camelCase!]
Or even your server’s Apache folder (or whichever server application you use).
Another trick that you can use is to check all your Apache’s .conf files in /etc/apache2/ and/or /etc/apache2/conf.d/ dir(s) and see where it calls for phpMyAdmin apache.conf file, there is your location! [Apache is only given as an example here, as it comes pre-configured for default Apache installation under Ubuntu]
Also, check that your current terminal user with which you are logged-in owns and can access those directories to read, modify etc.
August 22nd, 2016Thank you,
Regards
November 7th, 2016K-
hello every one today i have got a problem that in my system i have mysql workbench install, after that i have install xampp but when i used to start phpmyadmin is not working so i have got a solution that i have set the password which i have set in mysql workbench in the config.inc.php file and its working.
November 21st, 2016This fixed my issue when other resources didn’t!
Thanks!
January 26th, 2017thank you. worked for me.
May 28th, 2017Thank you worked for sure
November 28th, 2017Thank you so much..It worked for me after a long struggle
May 24th, 2019I cant find config-db.php on Mac OS
July 17th, 2019YES – worked! Thank you!
January 29th, 2020It perfectly worked for me, Thank you..!!
March 3rd, 2020Yes, Worked!!! Thanks a lot.
June 24th, 2021