FS#17179 - [php] Change default mysql socket path
Attached to Project:
Arch Linux
Opened by Evangelos Foutras (foutrelis) - Tuesday, 17 November 2009, 22:17 GMT
Last edited by Pierre Schmitz (Pierre) - Monday, 23 November 2009, 23:12 GMT
Opened by Evangelos Foutras (foutrelis) - Tuesday, 17 November 2009, 22:17 GMT
Last edited by Pierre Schmitz (Pierre) - Monday, 23 November 2009, 23:12 GMT
|
Details
Description:
The new MySQL package (5.1.40-1) has moved mysql.sock to /tmp/mysqld/mysql.sock. Therefore, the socket path passed to PHP during compilation needs to be adjusted. Additional info: * php 5.3.0-5 * mysql 5.1.40-1 Bug report requesting the path change: http://bugs.archlinux.org/task/14488 ([mysql] use standard directories for mysql config and mysqld.pid files ) |
This task depends upon
Closed by Pierre Schmitz (Pierre)
Monday, 23 November 2009, 23:12 GMT
Reason for closing: Fixed
Additional comments about closing: added workaround/patch until fixed by upstream
Monday, 23 November 2009, 23:12 GMT
Reason for closing: Fixed
Additional comments about closing: added workaround/patch until fixed by upstream
yes this make no sense, sock file will be into /var/run/mysqld/ with mysql-5.1.40-2
I'll try with PHP 5.3 since you mention that it has problems.
PHP 5.3.1 doesn't seem to do anything differently regarding the above, so it may need to be patched.
I'm testing a patch right now to verify this assumption.
I'm attaching the patch I'm trying to test, but I'm having trouble recreating the configure script (autoreconf freaks out O.o).
I tried to build it with mysqlnd.c patched. Of course I can connect now, but utf8 does not work anymore. This is unrelated to this bug but will delay the release of a new php package. For now I'd recommend to downgrade the mysql packages. Those should never have been moved to extra in their current state.
----
[1] http://aur.archlinux.org/packages.php?ID=30384
@Evangelos Foutras (foutrelis): Thanks for filing an upstream report.
[foutrelis@failboat ~]$ strings /usr/lib/php/modules/pdo_mysql.so | grep sock
pdo_mysql.default_socket
/tmp/mysql.sock
unix_socket
Also see my previous comment: http://bugs.archlinux.org/task/17179#comment53409
I'll include this information in the bug report upstream.
[foutrelis@foutboxd ~]$ php -r 'new PDO("mysql:", "root");'
PHP Warning: PDO::__construct(): [2002] Invalid argument (trying to connect via unix://) in Command line code on line 1
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Invalid argument' in Command line code:1
Stack trace:
#0 Command line code(1): PDO->__construct('mysql:', 'root')
#1 {main}
thrown in Command line code on line 1
But when it's commented out, or set to /var/run/mysqld/mysqld.sock, it will work as expected:
[foutrelis@foutboxd ~]$ php -r 'new PDO("mysql:", "root");'
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)' in Command line code:1
Stack trace:
#0 Command line code(1): PDO->__construct('mysql:', 'root')
#1 {main}
thrown in Command line code on line 1
Hums. .-.
The attached patch makes pdo_mysql use the pdo_mysql.default_socket in php.ini only if it's nonempty.
Can be applied with:
# don't use empty pdo_mysql.default_socket from php.ini
patch -p1 -i ${srcdir}/pdo-mysql-default-socket-nonempty.patch || return 1
I'll file a bug report upstream to get this fixed in future versions.