There is a environment variable to be add in the configuration if you cannot access the database locally:
MYSQL_ROOT_HOST: "%"
If you have mounted volumes, after stopping the container - delete them and run the container again with this environment variable.version: '3.4'
services:
mariadb:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: changeme
MYSQL_DATABASE: mybb
MYSQL_USER: mybb
MYSQL_PASSWORD: changeme
MYSQL_ROOT_HOST: "%"
networks:
- backend
restart: on-failure
volumes:
- ${PWD}/mariadb:/var/lib/mysql
networks:
frontend:
driver: bridge
backend:
driver: bridge
If you access the container - here is the user list:
MariaDB [(none)]> SELECT user, host FROM mysql.user;
+-------------+-----------+
| User | Host |
+-------------+-----------+
| mybb | % |
| root | % |
| mariadb.sys | localhost |
| root | localhost |
+-------------+-----------+