#116 packweb-multi-php: Allow php to contact local mysql with localhost

Merged
lpoujol merged 9 commits from mtrossevin/ansible-roles:packweb-multi-php2 into unstable 4 months ago
Owner

PHP translate localhost to a socket path when connecting to a mysql/mariadb database. This break when using packweb-multi-php as the socket isn't present in the containers.

This PR create a bind mount of the host /run/mysqld (=/var/run/mysqld) where this socket is present by default for the mariadb package in debian. It also change the default configuration of mysql so that it is also where the socket is put instead of /tmp/mysql.sock (the default with Oracle MySQL).

This PR was tested with an evolixised VM running Debian 10 (It worked !).

PHP translate localhost to a socket path when connecting to a mysql/mariadb database. This break when using packweb-multi-php as the socket isn't present in the containers. This PR create a bind mount of the host /run/mysqld (=/var/run/mysqld) where this socket is present by default for the mariadb package in debian. It also change the default configuration of mysql so that it is also where the socket is put instead of /tmp/mysql.sock (the default with Oracle MySQL). This PR was tested with an evolixised VM running Debian 10 (It worked !).
mtrossevin added the
enhancement
label 4 months ago
lpoujol commented 4 months ago
Poster
Owner

LGTM

Just don't forget to also update the config for mysql client if you change the path of the UNIX socket in the role mysql-oracle

Gif tamponné

LGTM Just don't forget to also update the config for mysql client if you change the path of the UNIX socket in the role mysql-oracle ![Gif tamponné](https://media1.tenor.com/images/2cfad842ff3c7b9cca31d98d64a6c820/tenor.gif?itemid=17182961)
Poster
Owner

Just don’t forget to also update the config for mysql client if you change the path of the UNIX socket in the role mysql-oracle

Done

Cc: @lpoujol

> Just don’t forget to also update the config for mysql client if you change the path of the UNIX socket in the role mysql-oracle Done Cc: @lpoujol
lpoujol merged commit 82d9abca3d into unstable 4 months ago
The pull request has been merged as 82d9abca3d.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.