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

Merged
lpoujol merged 9 commits from mtrossevin/ansible-roles:packweb-multi-php2 into unstable 2020-10-26 09:29:20 +01:00
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 2020-10-19 17:46:05 +02:00
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)
Author
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 2020-10-26 09:29:18 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: evolix/ansible-roles#116
No description provided.