title: How can I connect a adminer docker container with a mariadb docker container?
body: <p>I was trying to create a PHP development environment with PHP, MariaDB, and a tutorial suggested to use Adminer for database management. So I generate my <code>docker-compose.yml</code> file like this:</p>
  <pre class="lang-yaml prettyprint-override"><code>version : '3.1'
  
  services:
    php:
      build:
        context: .
        dockerfile: Dockerfile
      ports:
        - 80:80
      volumes:
        - ./src:/var/www/html/
    db:
      image: mariadb
      restart: always
      environment:
        MYSQL_ROOT_PASSWORD: example
      volumes:
        - ./mariadb-data:/var/lib/mysql
    adminer:
      image: adminer
      environment:
        ADMINER_DEFAULT_SERVER: db
      restart: always
      ports:
        - 8080:8080
  </code></pre>
  <p>But when I set the volumes for MariaDB, I got an error in the Adminer login page. When I don't set them it seems to work well.</p>
  <p><a href="https://i.stack.imgur.com/LRRFr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LRRFr.png" alt="enter image description here" /></a></p>