Edit report at https://bugs.php.net/bug.php?id=45468&edit=1

 ID:                 45468
 Comment by:         php at mike2k dot com
 Reported by:        michael dot kofler at gmx dot com
 Summary:            Using mysqlnd defaults to using unix socket instead
                     of localhost:port
 Status:             Closed
 Type:               Bug
 Package:            MySQL related
 Operating System:   * (not win32)
 PHP Version:        5.3CVS, 6CVS (2009-04-25)
 Assigned To:        johannes
 Block user comment: N
 Private report:     N

 New Comment:

okay - I just recompiled, and perhaps I didn't fully restart it last time. It 
*seems* to work now.

./configure \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
...

checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... 
/var/lib/mysql/mysql.sock
checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock
checking for MySQLi support... yes
...
checking for MySQL support for PDO... yes

it seems to work now. I think I forgot to restart FPM when I tried last. It was 
unclear in this bug report though what the fix seemed to be or when it happened 
:p


Previous Comments:
------------------------------------------------------------------------
[2011-09-19 22:30:17] php at mike2k dot com

Still an issue - even with mysqli.default_socket and mysql.default_socket set, 
it's still looking for /tmp/mysql.sock

It's not defined as that anywhere, phpinfo() shows that I am pointing to 
/var/lib/mysql/mysql.sock as well.

I don't want to do a symlink hack. I am running PHP 5.3.8 under FPM.

'./configure' '--prefix=/opt/php53' '--with-config-file-path=/opt/php53/etc' '--
with-config-file-scan-dir=/opt/php53/etc/conf.d' '--enable-fpm' '--with-
libdir=lib64' '--enable-cli' '--enable-inline-optimization' '--disable-rpath' '-
-disable-ipv6' '--with-gettext' '--with-readline' '--enable-mbstring' '--enable-
mbregex' '--enable-sqlite-utf8' '--with-gettext' '--enable-intl' '--with-
mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-curl' 
'--with-zlib' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-xpm-dir' '-
-with-freetype-dir' '--enable-gd-native-ttf' '--enable-exif=shared' '--enable-
shmop' '--with-xsl=shared' '--enable-soap=shared' '--with-mssql=shared' '--
enable-sockets' '--enable-pcntl=shared' '--with-mcrypt' '--with-bz2' '--with-
tidy=shared' '--with-pcre-dir' '--with-openssl' '--with-ldap=shared' '--with-
imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-pear' '--with-gmp' '--
with-pdo-dblib' '--with-xmlrpc'

------------------------------------------------------------------------
[2010-11-30 11:44:07] me dot deepa dot selvam at hotmail dot com

PHP Warning:  mysql_connect(): [2002] A connection attempt failed because the 
connected party did not  (trying to connect via tcp://localhost:3306) in 
C:\inetpub\wwwroot\test.php on line 3

I got this error on running my php file:test.php

<?php
echo "Got it............test.php";
$con=mysql_connect("localhost","root","pa@onicz");
if(!$con)
        die('Could not connect: '.mysql_error());
echo "Connection Success";
?>

I am working on windows 7 + IIS 7 + php 5.3.3 + MySQL 5.1.53

Someone please help me...

------------------------------------------------------------------------
[2010-05-06 12:33:13] wolfgang_weber at gmx dot at

Sorry for double posting, but I'd like to add a quote:

"The default location for the Unix socket file that the server uses for 
communication with local clients is /tmp/mysql.sock. (For some distribution 
formats, the directory might be different, such as /var/lib/mysql for RPMs.)"

From: http://dev.mysql.com/doc/refman/5.1/en/problems-with-mysql-sock.html

Regards
Wolfgang

------------------------------------------------------------------------
[2010-05-06 12:25:11] wolfgang_weber at gmx dot at

I don't know why this ticket has been closed as I am still affected from this 
bug.

PHP: 5.3.2 with mysqlnd and php-fpm patch from svn
MySQL: 5.1.46
OS: Centos 5.4 x86_64

Configure options:

--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-mysql-sock=/var/lib/mysql \

Tried to add a zone in ZoneAdmin, and this is a part from my error log:

[06-May-2010 12:08:39] PHP Warning:  mysql_connect(): [2002] No such file or 
directory (trying to connect via unix:///tmp/mysql.sock) in 
/var/www/tools/zoneadmin/includes/config.php on line 28

So why do you think that this is not a bug anymore?

Kind regards
Wolfgang Weber

------------------------------------------------------------------------
[2009-08-27 10:35:27] [email protected]

Closing this, as not a bug anymore

------------------------------------------------------------------------


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=45468


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=45468&edit=1

Reply via email to