Hello,
I am trying to install matomo (last version) over docker. Currently, matomo stops always by step three Database Setup with the error:
Error while trying to connect to the database server: SQLSTATE[HY000] [2002] Connection refused
For solving the problem I already saw many forum topics and tried such as … - without success:
I had tried to change the database server to localhost or own server IP address.
I created a new user via terminal - by terminal mysql login is possible - on matomo login not.
I checked the port 3306 and 33060.
I gave /var/www/html/matomo www-data permissions.
I had reinstall mysql.
Have someone a hint or idea to solve this error?
Is there another way to see logs related to the issue why matomo can’t login to the mysql?
Here my settings:
docker-compose.yml
version: "3"
services:
db:
image: mariadb
command: --max-allowed-packet=64MB
restart: always
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=...
- MYSQL_PASSWORD=...
- MYSQL_DATABASE=matomo
- MYSQL_USER=matomo
app:
image: matomo
restart: always
volumes:
- matomo:/var/www/html
environment:
#- MATOMO_DATABASE_HOST=db
- MATOMO_DATABASE_ADAPTER=mysql
- MATOMO_DATABASE_TABLES_PREFIX=matomo_
- MATOMO_DATABASE_USERNAME=matomo
- MATOMO_DATABASE_PASSWORD=...
- MATOMO_DATABASE_DBNAME=matomo
ports:
- 8080:80
volumes:
db:
driver_opts:
type: none
device: /var/lib/docker/volumes/...
o: bind
matomo:
driver_opts:
type: none
device: /var/lib/docker/volumes/...
o: bind