Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

MySQL works well, I have running site on it.

I can connect to the database using mysql -u... -p.... -h.... successfully.

The DB is NOT on the localhost but another server.

Tried both hostname and IP in $cfg['Servers'][$i]['host'] = '';

A lot of space available.

User is not root, $cfg['Servers'][$i]['connect_type'] = 'tcp';

CentOS 6.3, phpMyAdmin- from default repo

Please help.

Edited: I hit the same issue on another server, but the message is a bit different:

#2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

But I have

$cfg['Servers'][$i]['host'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

Next, I add a bit of garbage to the top of I expect to see syntax error but nothing happened, thus I think PMA just does not see/use this file.

ls -l
-rw-r--r-- 1 apache apache 3981 Sep  3 07:59

I have no ideas. Please help.

share|improve this question
1. are you trying to log in with root? 2. did you change configuration of pma? 3. do you use mysql from default repo? 4. netstat -anp|grep mysq|grep LIST 5. rpm -V phpMyAdmin mysql-server – GioMac Aug 29 '13 at 18:57
Check your config for what it's using to connect. Make sure it's tcp and not socket. – Nathan C Aug 29 '13 at 18:57
Have just edited the question, User is not root, $cfg['Servers'][$i]['connect_type'] = 'tcp'; – Putnik Aug 29 '13 at 19:29
@GioMac 2. the only configuration change is host afaik but I can post config if needed 3. unknown, it is installes by hosting provider and I have user assess only (to MySQL, but root locally) 4.mysql is NOT on the local box 5. S.5....T. c /etc/httpd/conf.d/phpMyAdmin.conf S.5....T. c /etc/phpMyAdmin/ phpMyAdmin.conf was changed because I use not the default /phpMyAdmin location – Putnik Aug 29 '13 at 19:35
getenforce :) I think httpd is not allowed to db connect by selinux – GioMac Aug 29 '13 at 19:37
up vote 2 down vote accepted

I found it eventually! Perhaps this will work for PMA from rpms only.

Despite PMA itself is in /usr/share/phpMyAdmin it expects to have config dir at /var/lib/phpMyAdmin/ and config in /etc

Solution: just edit ./libraries/vendor_config.php and set the correct paths or

ln -s /usr/share/phpMyAdmin/ /var/lib/phpMyAdmin/config/

Edit 3 months later: On another server it checks /etc/phpMyAdmin/ instead of /usr/share/phpMyAdmin/ - so added this hard link and it works well now.

share|improve this answer
where did you hardcoded /usr/share/phpMyAdmin/ ? i can't find a solution to this problema – Lachezar Raychev Oct 13 '14 at 11:23
@LachezarRaychev try to find vendor_config.php – Putnik Oct 14 '14 at 18:37

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.