|Summary:||databases/php7[2-4]mysqli and databases/php7[2-4]-pdo_mysql: can't connect to mariadb via socket due to changes to the default socket dir|
|Product:||Ports & Packages||Reporter:||SBB <maniactraq>|
|Component:||Individual Port(s)||Assignee:||Torsten Zuehlsdorff <tz>|
|Status:||Closed Works As Intended|
|Severity:||Affects Many People||CC:||brnrd, tz|
koobs: maintainer-feedback? (brnrd)
Description SBB 2020-07-09 00:59:43 UTC
Recent changes to mariadb changed the default location of mysql.sock from /tmp/ to /var/run/mysql/ which causes PHP scripts to not be able to connect without manually adding the path in php.ini. See bug #246694 for more info. It was my understanding that PHP was supposed to be able to automatically figure out the correct location for the socket directory when it's compiled however I've tried reinstalling the php74, php74-mysqli, and php74-pdo_mysql ports via "make install clean" but it still doesn't work. Is this something that can be fixed via a patch or is the only way to manually go edit the php.ini file on every affected server?
Comment 1 Kubilay Kocak 2020-07-09 01:11:24 UTC
^Triage: - Assign to php-* maintainer - Request feedback from MariaDB maintainer
Comment 2 Bernard Spil 2020-07-11 21:45:06 UTC
Confirmed. The default socket path has changed for the ports, but not for existing configurations in /var/db/mysql/my.cnf. Result is that mariadbd uses /var/db/mysql/mysql.sock whereas the client's default installation uses /var/run/mysql/mysql.sock. This is documented in UPDATING 20200526. Closing this bug as "Works as intended". I know this affects you and is a POLA violation, but I have to get the MariaDB ports to respect hier(7). Changing the rc(8) script in the 10.4 version to change the default my.cnf felt too breaking to pursue. If you upgrade to 10.5 this "shoul all work" (TM). I am interested in your experience in non-production environments. (The first GA release is not the one you want to run in production).