Re: [Sqlrelay-discussion] Sqlrelay 0.39.4 + dropin mysql library + PHP 5.1.6 + MySQL 5.0.22
Brought to you by:
mused
|
From: Jani O. <jan...@pr...> - 2008-06-05 08:34:11
|
Jani Ollikainen wrote:
And if this helps I straced the normal mysql client:
connect(3, {sa_family=AF_FILE, path="/tmp/sqlrelay.sock"}, 110) = 0
setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = -1 EOPNOTSUPP (Operation
not suppo
rted)
write(3, "\0\0\0\10sqlrelay\0\0\0\tpass", 25) = 25
read(3, "\0\1\0\0", 8192) = 4
write(3, "\0\v\0\0\0\10sqlrelay\0\0\0\tpass", 27) = 27
read(3, "\0\1", 8192) = 2
It write()'s before tries to read() which PHP mysql
doesn't do.
PHP code for connection is:
try {
$dbh = new
PDO("mysql:unix_socket=/tmp/sqlrelay.sock;dbname=www",_SQLUSER, _SQLPASS);
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}
And the _SQLUSER and _SQLPASS are the user/pass for
sqlrelay not for the mysql.
With LD_PRELOAD defined the normal mysqlsocket connection
works..
connect(3, {sa_family=AF_FILE, path="/var/lib/mysql/mysql.sock"}, 110) = 0
setsockopt(3, SOL_IP, IP_TOS, [8], 4) = -1 EOPNOTSUPP (Operation not
supported
)
setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
read(3, "8\0\0\0\n5.0.22-log\0\371\4\0\0]Z,iN)#q\0,\242\10"..., 16384) = 60
So it seems like for some reason the LD_PRELOAD won't do it's trick?
> Hi,
>
> Subject is the problem.
>
> If I set the LD_PRELOAD cli mysql client
> can connect and works nicely.
>
> But with PHP neither pdo_mysql or mysql
> works. It just hangs when connecting.
>
> Strace says it is trying to connect the
> right socket but it just cannot get anything from there.
>
> Any ideas?
>
> The system is CentOS.
>
> Strace output:
> connect(3, {sa_family=AF_FILE, path="/tmp/sqlrelay.sock"}, 110) = 0
> setsockopt(3, SOL_IP, IP_TOS, [8], 4) = -1 EOPNOTSUPP (Operation not
> supported)
> setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
> read(3,
>
> # ldd php-cli
> linux-gate.so.1 => (0x00110000)
> /usr/lib/libmysql50sqlrelay.so (0x0018a000)
> libcrypt.so.1 => /lib/libcrypt.so.1 (0x00cf3000)
> libaspell.so.15 => /usr/lib/libaspell.so.15 (0x005e4000)
> libpspell.so.15 => /usr/lib/libpspell.so.15 (0x00ce8000)
> libgmp.so.3 => /usr/lib/sse2/libgmp.so.3 (0x003ff000)
> libdb-4.3.so => /lib/libdb-4.3.so (0x006a7000)
> libpthread.so.0 => /lib/libpthread.so.0 (0x00c78000)
> libcurl.so.3 => /usr/lib/libcurl.so.3 (0x005a6000)
> libbz2.so.1 => /usr/lib/libbz2.so.1 (0x00de6000)
> libz.so.1 => /usr/lib/libz.so.1 (0x00cd3000)
> libpcre.so.0 => /lib/libpcre.so.0 (0x00dc7000)
> libresolv.so.2 => /lib/libresolv.so.2 (0x00d4a000)
> libm.so.6 => /lib/libm.so.6 (0x00c91000)
> libdl.so.2 => /lib/libdl.so.2 (0x00c2a000)
> libnsl.so.1 => /lib/libnsl.so.1 (0x00d23000)
> libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00472000)
> libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00d97000)
> libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00323000)
> libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00d5f000)
> libcom_err.so.2 => /lib/libcom_err.so.2 (0x00ae3000)
> libssl.so.6 => /lib/libssl.so.6 (0x003b8000)
> libcrypto.so.6 => /lib/libcrypto.so.6 (0x001ee000)
> libidn.so.11 => /usr/lib/libidn.so.11 (0x00435000)
> libc.so.6 => /lib/libc.so.6 (0x00ae8000)
> libsqlrclient-0.39.4.so.1 => /usr/lib/libsqlrclient-0.39.4.so.1
> (0x00111000)
> librudiments-0.31.so.1 => /usr/lib/librudiments-0.31.so.1
> (0x0079e000)
> librt.so.1 => /lib/librt.so.1 (0x0012a000)
> libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0081a000)
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00d3c000)
> /lib/ld-linux.so.2 (0x00ac6000)
> libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00d87000)
> libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00d92000)
> libselinux.so.1 => /lib/libselinux.so.1 (0x00cba000)
> libsepol.so.1 => /lib/libsepol.so.1 (0x00c30000)
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Sqlrelay-discussion mailing list
> Sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
|