Menu

#4045 phpMyAdmin fails to connect to MySQL via named pipes (Windows).

4.0.4
invalid
nobody
None
5
2014-12-30
2013-08-06
Aras
No

This appears to be a “bug” when phpMyAdmin fails to connect to MySQL server via named pipe with different from default (i.e “mysql”) name.

System: Windows 7 Ultimate (x32 and x64), SP1
Server: Apache/2.4.4 (Win64 and Win32) with mod_fcgid/2.3.7
phpMyAdmin version: 4.0.4.1 (but previous versions was noted to behave in identical maner);
MySQL Server version: 5.6.12 - MySQL Community Server (GPL) (same with previous stable versions);
php version - 5.5.0 (same with previous stable versions).

Connection established only when default pipe's name (i.e “mysql”) is configured as follows:

My.ini
[client]
socket = "mysql" (optional)
pipe
[mysqld]
socket = "mysql" (optional)
skip-networking
enable-named-pipe

config.inc.php
$cfg['blowfish_secret'] = 'whatever';
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = '.';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

As soon as the default name (“mysql”) of the pipe is changed to any other name, the phpMyAdmin is not able to connect to MySQL server.

Connection error: "#2002 Cannot log in to the MySQL server".

It is not possible to establish connection even when the new name of the pipe is configured with the following setting $cfg['Servers'][$i]['socket'] = ''; in the config.inc.php ((e.g. $cfg['Servers'][$i]['socket'] = 'mysql.sock';))

Examples of the names of pipes that are not working (my.ini):
socket = “mysql1”
socket = "mysql33"
socket = “mysql.sock”
etc.

Discussion

  • Marc Delisle

    Marc Delisle - 2013-08-06

    Do you have another PHP application that is able to connect via a named pipe that is different from the default?

     
  • Marc Delisle

    Marc Delisle - 2013-08-07
    • status: open --> pending
     
  • Aras

    Aras - 2013-08-07

    Thank you for your prompt response.

    Good question, which I would ask at the very beginning also. My short answer is NO. I have just started new project of running separate MySQL instances and related with them databases.

    As an example, a quick checkup without any special intervention into code showed that Joomla installation is not working if the name of pipe is changed, which is obvious.

    Concerning the phpMyAdmin connection issue though, according to documentation, if all necessary settings are present, the connection with MySQL server should be established with no problem; which is not happening in reality for some reason.

    Additional info: I am able to make connection to MySQL via pipes with different names from command line with no problems.

     
  • Marc Delisle

    Marc Delisle - 2013-08-07

    I don't understand "which is obvious". You are saying that Joomla has the same connection problem than phpMyAdmin? If so, then there is a problem at the PHP layer.

     
  • Aras

    Aras - 2013-08-08

    Yes, I have noticed that Joomla showed same connectivity problem. Therefore, just to be certain, I conducted extra testing with the following script (mysqli_connect_test.php):

    host_info . "\n"; $db->close(); ?>

    Result:
    Success... \.\pipe\MySQL via named pipe

    After I changed pipes name to “mysql1” in my.ini and the script, I received connection error:
    [07-Aug-2013 21:52:21 America/New_York] PHP Warning: mysqli::mysqli(): (HY000/2002): Unknown errror while connecting in E:\www\phpTest\mysqli_connect_test.php on line 4

    Probably you are correct concerning the php layer. However, I was not getting any php errors before, so the php layer seemed to be working fine until now. At this moment I am somewhat confused since this is quite new topic for me. I will be looking more deeply into the php. Perhaps you also have some ideas to post regarding what settings I should be looking at to resolve the issue if any. Thanks for your time.

     
  • Marc Delisle

    Marc Delisle - 2013-08-08

    I'm not familiar with this aspect of PHP/MySQL, so I suggest you visit http://php.net/support.php to see what are your support options.

     

    Last edit: Marc Delisle 2013-08-08
  • Marc Delisle

    Marc Delisle - 2013-08-08
    • status: pending --> invalid
     
  • Aras

    Aras - 2013-08-10

    I have to finalize the question. The issue has been solved. In Windows a path to the named pipe has to contain escape slashes:

    $cfg['Servers'][$i]['socket'] = '\\\\.\\pipe\\pipes.name';

    Maybe someone will find this to be helpful.