Bug->Doc #61570 [Opn]: mysqlnd cannot connect to MySQL when only named pipe is enabled

From: Date: Fri, 04 May 2012 10:18:29 +0000
Subject: Bug->Doc #61570 [Opn]: mysqlnd cannot connect to MySQL when only named pipe is enabled
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8340@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61570&edit=1 ID: 61570 User updated by: peaceable_whale at hotmail dot com Reported by: peaceable_whale at hotmail dot com Summary: mysqlnd cannot connect to MySQL when only named pipe is enabled Status: Open -Type: Bug +Type: Documentation Problem Package: mysql Operating System: Windows Server 2008 R2 PHP Version: 5.4.1 Block user comment: N Private report: N New Comment: Finally, I found that the connection problem is caused by the use of open_basedir. It appears that named pipe cannot be used with open_basedir. I have changed the type of this report to be documentation problem. I think the documentation should mention that: - "." should be used instead of "localhost" for named pipe connection - Named pipe will fail when open_basedir is in effect Previous Comments: ------------------------------------------------------------------------ [2012-05-04 08:49:14] peaceable_whale at hotmail dot com Yes, I am able to connect using the following command: mysql -W -u root -p ------------------------------------------------------------------------ [2012-05-04 08:45:53] uw@php.net Can you connect to MySQL using named pipe and the mysql prompt (http://dev.mysql.com/doc/refman/5.5/en/connecting.html)? ------------------------------------------------------------------------ [2012-05-03 08:33:50] peaceable_whale at hotmail dot com Changed affected PHP version to 5.4.1. ------------------------------------------------------------------------ [2012-04-26 03:33:15] peaceable_whale at hotmail dot com When using "." as the hostname, the following warning is returned: Warning: mysqli::mysqli(): (HY000/2002): Unknown errror while connecting When using "\\\\.\\pipe\\MySQL". as the hostname, the following error is returned: php_network_getaddresses: getaddrinfo failed: No such host is known. Regarding documentation, if "." is required for named pipe connection, the PHP documentation, not the MySQL documentation, should explicitly state so. Currently, it only states "Can be either a host name or an IP address. Passing the NULL value or the string "localhost" to this parameter, the local host is assumed. When possible, pipes will be used instead of the TCP/IP protocol.", I expected that passing "localhost" will cause pipes to be used when possible, and did not expect "." is supported as it is not a valid hostname or IP address. ------------------------------------------------------------------------ [2012-04-25 19:52:42] andrey@php.net I don't want to be rude. Please read, the MySQL documentation. When you want to use named pipes your host should not be "localhost". "localhost" has a special meaning only on Unix(-like) systems, where it means "use unix socket file", while on windows it will be resolved as 127.0.0.1 and TCP connection will be tried to be established. On Windows, to use named pipes, you should use "." (dot) as host, which will in turn use the default named pipe name \\.\pipe\MySQL (if you use the name in your code you should escape the slashes, if you use double quotes "\\\\.\\pipe\\MySQL". Please try this and report your success or failure. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=61570 -- Edit this bug report at https://bugs.php.net/bug.php?id=61570&edit=1

« previous php.doc.bugs (#8340) next »