Skip to content

How to login to MariaDB Docker Container via PhpMyAdmin? #365

Closed
@jchariot

Description

@jchariot

I am trying to deploy PHPMyAdmin and mariadb via docker-compose, but I ran into a docker problem.

Here is my docker-compose file:

version: '3'

networks:
  my_docker_network:

services:

  db:
    networks:
      - my_docker_network
    image: mariadb:10.3
    command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      - MYSQL_ROOT_PASSWORD=*****
      - MYSQL_DATABASE=*****
      - MYSQL_USER=myuser
      - MYSQL_PASSWORD=*****
    volumes:
      - ./data:/var/lib/mysql
      - ./init-db:/docker-entrypoint-initdb.d
      - ./my.cnf:/etc/mysql/my.cnf  # set bind-address           = 0.0.0.0
      - "/etc/timezone:/etc/timezone:ro"
      - "/etc/localtime:/etc/localtime:ro"
    restart: always
  pma:
    networks:
      - my_docker_network
    image: phpmyadmin/phpmyadmin
    ports:
      - ****:80
    environment:
      - PMA_HOST=db

On PhpMyAdmin, when I tried to login, I got the message:

mysqli::real_connect(): (HY000/1045): Access denied for user 'myuser'@'172.25.0.4' (using password: YES)

172.25.0.4 is IP of the docker container. So I couldn't login with this. Both root and myuser have @'172.25.0.4' so this makes me unable to login. What must be done in this case if I am to login?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions