Edit mysql ini in container

3

I am using docker to generate a LAMP. My yml looks like this:

    web:
     image: tutum/apache-php
     ports:
     - "80:80"
     links:
     - db
     volumes:
     - $PWD:/app

    db:
     image: mysql
     environment:
     - MYSQL_ROOT_PASSWORD= my-secret-pw
     - MYSQL_DATABASE= lamp
     - MYSQL_USER= lamp_user
     - MYSQL_PASSWORD= lamp_pass
     ports:
     - "3306:3306"

When trying to access mysql through another machine, it is giving the following error in the workbench:

Authentication plugin 'caching_sha2_password' cannot be loaded

I saw a group saying that I have to edit my.ini and edit the following line with this value:

[mysqld] default_authentication_plugin=mysql_native_password

But I'm not sure how to edit my.ini .

Am I following the correct solution? If so, how do I edit the file in question?

    
asked by anonymous 28.08.2018 / 14:14

1 answer

2

Apparently setting the version to be used from mysql, and not leaving latest , solved my problem.

No yml below note that I set the mysql version to 5.6.
Of breaking I added restart: always to restart automatic the two containers

        web:
         image: tutum/apache-php
         ports:
         - "80:80"
         links:
         - db
         volumes:
         - $PWD:/app
         restart: always

        db:
         image: mysql:5.6
         environment:
         - MYSQL_ROOT_PASSWORD= my-secret-pw
         - MYSQL_DATABASE= lamp
         - MYSQL_USER= lamp_user
         - MYSQL_PASSWORD= lamp_pass
         ports:
         - "3306:3306"
         restart: always
    
28.08.2018 / 15:34