Mysql – Access /etc/thesql/the.cnf using Docker

dockerMySQL

How can I edit /etc/mysql/my.cnf if I use this docker-compose? I need to comment bind-address out to allow connections from all hosts.

https://github.com/indiehosters/piwik/blob/master/docker-compose.yml

Best Answer

Access the docker container using it's ID

sudo docker exec -i -t 665b4a1e17b6 /bin/bash

Navigate to /etc/mysql/my.cnf

  cd /etc/mysql/my.cnf

Install Nano text editor

apt-get install nano

Export environment variable

export TERM=xterm

Edit your file

nano my.cnf