1

The MySQL service on my CentOS 6.3 server works well. I'm using phpMyAdmin-3.5.8.1 from default repository. I have sites that can connect to the databases and are using them successfully.

I can also connect to the database server using the mysql -u... -p.... -h.... command.

The database is NOT on the localhost but another server.

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

I also have a lot of free space available.

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

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'] = '192.168.100.219';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

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

ls -l config.inc.php
-rw-r--r-- 1 apache apache 3981 Sep  3 07:59 config.inc.php

I have no ideas. What am I doing wrong?

Putnik
  • 2,217
  • 4
  • 27
  • 43
  • 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/config.inc.php 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
  • @GioMac wordpress works pretty well on the same apache/database – Putnik Aug 29 '13 at 19:43
  • still, `getenforce` and double-check config.inc.php - problem is in selinux or config.inc.php. pastebin.com – GioMac Aug 29 '13 at 19:44
  • # getenforce Disabled http://pastebin.com/gvG5najZ (comments removed) – Putnik Aug 29 '13 at 20:09
  • you are missing port option. also, better use mysqli extension. Looks like there's huge difference between original and this file. overwrite with original one (from package) and change ip, port, socket to tcp and mysql to mysqli – GioMac Aug 30 '13 at 10:35
  • @GioMac here http://wiki.phpmyadmin.net/pma/Config#port mentioned default port 3306 and in config.sample.inc.php port is absent as well. Nevertheless I started with config.sample.inc.php, add host and port and got the same result. – Putnik Aug 30 '13 at 12:55

2 Answers2

2

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/config.inc.php /var/lib/phpMyAdmin/config/

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

Putnik
  • 2,217
  • 4
  • 27
  • 43
0

On an Amazon Linux server (i.e. Amazon's RHEL-like distribution) it looks for the config file in /etc/phpMyAdmin as the poster above described.

Richard Sand
  • 121
  • 2