How to connect phpmyadmin to mySql server with docker compose

I’m trying to reproduce a MAMP environment with Docker-Compose, but I can’t connect the phpmyadmin service to my mariaDB database!

I have done a lot of testing, and nothing has been conclusive, at best phpmyadmin does not recognize user and password and I get the following message:

mysqli_real_connect(): (HY000/1045): Access denied for user ‘root’@’172.25.0.3’ (using password: YES)

Here is the docker-compose file:

version: '3'

services:
    php-apache:                                                                

        build:
            context: ./php-apache
        container_name: cbx-webserver
        ports:
            - 80:80                                     # Le port dédié à ce service    
        restart: always     
        volumes:
            - ./DocumentRoot:/var/www/html              
        links:
            - mariadb                                   

    mariadb:
        image: mariadb:10.1
        container_name: db-mysql
        ports: 
            - 3306:3306
        restart: always
        volumes:
            - ./mariadb:/docker-entrypoint-initdb.d/
            - mariadb:/var/lib/mysql                   
        environment:                                    
            MYSQL_ROOT_PASSWORD: root
            MYSQL_ROOT_USER: root
            MYSQL_HOST: mariadb
            MYSQL_DATABASE: mydb


    myadmin:
        image: phpmyadmin/phpmyadmin:4.8.1
        container_name: cbx-phpmyadmin
        ports:
          - 8081:80
        restart: always
        links:
            - mariadb:mysql
        environment: 
            PMA_HOST: mydb
            PMA_PORT: 3306
            PMA_USER: root
            PMA_PASSWORD: root
        depends_on:
          - mariadb

volumes:                                                
    mariadb:

and the actual error message

Source: Docker Questions