fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
429 stars 294 forks source link

Support UNIX socket connection for MySQL/MariaDB #4876

Closed jacrasmussen closed 8 months ago

jacrasmussen commented 10 months ago

To support unix socket connections to MySQL/MariaDB it's necessary to add an additional parameter (unix_socket) to the connection.

fisharebest commented 10 months ago

If you select localhost as the server, then the connection should use the unix socket automatically.

(But if you select 127.0.0.1, the the connection will use the mysql network protocol).

In your php.ini configuration file, the setting for pdo_mysql.default_socket must be set to the correct path.

jacrasmussen commented 10 months ago

I actually tried that among other suggestions, but I hadn't any luck connecting to the database until I reviewed the Laravel logic and found that the unix_socket parameter must be set.

I've prepared a change that I'm happy to share as a pull request, I've run the tests and setup locally and confirmed the change works and connects as expected against the socket.

fisharebest commented 8 months ago

f24a8589f7d8400d503c5bb64be9ca10e1637659

Screenshot 2023-11-04 at 18 04 45