Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

437
Vistas
How to fix 'The server requested authentication method unknown to the client [caching_sha2_password]' on docker compose?

I'm setting up a wamp. The docker-compose was working very well until I experience some problems with the phpmyadmin and mysql container. I couldn't connect nor from php or phpmyadmin and usually had this error message : mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]

I was able to solve the problem by just connecting entering the shell of the db container docker exec -it db mysql -uroot -p and running this command : ALTER USER 'root' IDENTIFIED WITH mysql_native_password by '123456'; But this kind of boring because I have a partner working on the same project and we have to change working posts a lot so it means rerun docker each time in the development phase so I was wondering what's wrong on my docker-compose...

Here it is :

version: "3.1"
services:
    www:
        build: .
        container_name: app
        ports: 
            - "8001:80"
        volumes:
            - ~/Desktop/WORK_in_progress/camagru/www/:/var/www/html/
        links:
            - db
        networks:
            - default
    db:
        image: mysql:8.0
        container_name: db
        restart: always
        tty: true
        ports: 
            - "3306:3306"
        command: --default-authentication-plugin=mysql_native_password
        command: --innodb-use-native-aio=0
        environment:
            MYSQL_DATABASE: CAMAGRU
            MYSQL_USER: user
            MYSQL_PASSWORD: 123456
            MYSQL_ROOT_PASSWORD: 123456 
        volumes:
            - ~/Desktop/WORK_in_progress/camagru/dump:/docker-entrypoint-initdb.d
            - ~/Desktop/WORK_in_progress/camagru/conf:/etc/mysql/conf.d
            - persistent:/var/lib/mysql
        networks:
            - default
    phpmyadmin:
        container_name: phpmyadmin
        restart: always
        tty: true
        image: phpmyadmin/phpmyadmin
        links: 
            - db:db
        ports:
            - 8000:80
        environment:
            MYSQL_USER: user
            MYSQL_PASSWORD: 123456
            MYSQL_ROOT_PASSWORD: 123456
volumes:
    persistent:

note : I don't use any configurations file, I modified a bit a compose that I found online.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Your command is right, the issue appears because you have defined the command key two times, and the second one is overriding the first one. Instead you should define it only once and like this:
command: --default-authentication-plugin=mysql_native_password --innodb-use-native-aio=0

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda