Connecting to Dockerized MySQL from remote client

tl;dr: database used to be connectable from remote, but after dockerizing it, it isn’t (though i can access from host).

I’ve set up a docker container running MySQL in an ec2 instance, using the following command:

  • Bluemix Docker Container cf ic login the local Docker daemon is not reachable to authenticate
  • Docker error while creating couchbase - ulimit: open files: cannot modify limit: Operation not permitted
  • Cannot connect from MySQL Workbench to dockerized MySQL server
  • how to run a daemon process in docker container with API/v1.5?
  • Alternatives to inotify for watching file changes in a NFS volume in a Docker container?
  • docker compose version 2 recreates container when it should not
  • sudo docker run --name mysql-csm -p 3306:3306 -v /db/mysql:/var/lib/mysql -v /db/mysql-config:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=password -d mysql
    

    where: -v /db/mysql:/var/lib/mysql maps my host’s database to the docker

    and

    -v /db/mysql-config:/etc/mysql/conf.d maps my host custom config file to the dockerized MySQL config. the host file is supposed to take precedent, and my custom config contains one line:

    [mysqld]
    
    bind-address = 0.0.0.0
    

    I am able to connect to the database via host command-line using the following:

    sudo docker run -it --link mysql-csm:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -u"user" -p"pw"'
    

    From the MySQL command-line, all of the tables, etc., are present & look good. This database ran in a regular MySQL version previously, and I could connect remotely.

    However, when trying to connect from my laptop using MySQL Workbench, I receive the error:

    Table 'performance_schema.session_variables' doesn't exist
    

    Googling suggests it’s something to do with upgrading, but I’m not sure how to address that.

    ETA: I get the same error when trying to login thru SSH -> TCP/IP via MySQL Workbench.

  • Unable to build docker from root
  • How to restore snapshot of docker image (for testing purpose, every test on this same docker image)
  • How to change nginx config in amazon elastic beanstalk running a docker instance
  • Angular2 docker setup for multiple environments
  • node.js proxy app in docker behind nginx proxy
  • Angular2 cannot find module: './class' within docker
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.