I am running both “matomo:latest” and “mariadb:latest” in a Docker Container on a fresh Ubuntu 18.04 install. And yes, I did try the ideas mentioned in the FAQ. They did not work.
docker-compose.yml:
version: '3'
services:
db:
image: "mariadb:latest"
container_name: "matomo_db"
command:
- "--max_allowed_packet=256M"
- "--wait_timeout=31536000"
restart: unless-stopped
networks:
- internal
volumes:
- /home/matomo/data/mysql:/var/lib/mysql
environment:
- MYSQL_RANDOM_ROOT_PASSWORD='1'
- MYSQL_PASSWORD=e783g7zhhf9f3g82309sd78fz43u
- MYSQL_DATABASE=matomo
- MYSQL_USER=matomo
app:
image: "matomo:latest"
container_name: "matomo"
restart: unless-stopped
networks:
- internal
- caddy_internal
ports:
- "6000:80"
- "6001:9000"
volumes:
- /home/matomo/data/matomo:/var/www/html
environment:
- MATOMO_DATABASE_HOST=matomo_db
- MATOMO_DATABASE_ADAPTER=mysql
- MATOMO_DATABASE_TABLES_PREFIX=matomo_
- MATOMO_DATABASE_USERNAME=matomo
- MATOMO_DATABASE_PASSWORD=e783g7zhhf9f3g82309sd78fz43u
- MATOMO_DATABASE_DBNAME=matomo
networks:
internal:
driver: "bridge"
caddy_internal:
external: "true"
I can browse to the Matomo setup page just fine, but when I’m supposed to enter the MySQL server details, I get the error message in Matomo:
Error while trying to connect to the database server: SQLSTATE[HY000] [2006] MySQL server has gone away
And the database itself says:
db_1 | 2020-07-28 4:20:53 5 [Warning] Aborted connection 5 to db: 'unconnected' user: 'unauthenticated' host: '192.168.32.3' (This connection closed normally without authentication)
db_1 | 2020-07-28 4:20:53 6 [Warning] Aborted connection 6 to db: 'unconnected' user: 'unauthenticated' host: '192.168.32.3' (This connection closed normally without authentication)
matomo | 192.168.0.2 - [28/Jul/2020:04:20:53 +0000] "POST /index.php?action=databaseSetup&clientProtocol=https HTTP/1.1" 200 3967 "https://stats.mydomain.com/index.php?action=databaseSetup&clientProtocol=https" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
db_1 | 2020-07-28 4:23:57 7 [Warning] Aborted connection 7 to db: 'unconnected' user: 'unauthenticated' host: '192.168.32.3' (This connection closed normally without authentication)
db_1 | 2020-07-28 4:23:57 8 [Warning] Aborted connection 8 to db: 'unconnected' user: 'unauthenticated' host: '192.168.32.3' (This connection closed normally without authentication)
matomo | 192.168.0.2 - [28/Jul/2020:04:23:57 +0000] "POST /index.php?action=databaseSetup&clientProtocol=https HTTP/1.1" 200 3988 "https://stats.mydomain.com/index.php?action=databaseSetup&clientProtocol=https" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
1 post - 1 participant