Error changing password (MYSQL_ROOT_PASSWORD), in Mysql Docker.compose.yml file

Asked

Viewed 454 times

1

I had to recently change the administrator password of my database (currently using Mysql), changed the password 'MYSQL_ROOT_PASSWORD' but did not reflect changes in my container. I tried to delete, build and try a forced refresh. But nothing worked.

# arquivo docker-compose.yml
version: "2"
services:
    www:
        build: .
        ports:
            - "8001:80"
        volumes:
            - ./www:/var/www/html/
        links:
            - db
        networks:
            - default
    db:
        image: mysql:5.6
        ports:
            - "3306:3306"
        environment:
            MYSQL_DATABASE: lista
            MYSQL_USER: root
            MYSQL_PASSWORD: 123
            MYSQL_ROOT_PASSWORD: 123
        volumes:
            - ./bd:/docker-entrypoint-initdb.d
            - persistent:/var/lib/mysql
        restart: always
        networks:
            - default
    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        links:
            - db:db
        ports:
            - 8000:80
        environment:
            MYSQL_USER: root
            MYSQL_PASSWORD: 123
            MYSQL_ROOT_PASSWORD: 123
volumes:
    persistent:
  • Only change in the commie will not solve anyway, since they are in the volume persistent. Access the container and change the password or recreate the volume

  • Exactly what @Brunocésar said. Did it?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.