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:

  • ADD command with network path in Windows Containers Dockerfiles
  • Symlink to volume in Docker container
  • Docker image for aspNet core hangs on windows
  • Docker dotnet image container do not allow me to rebuild after change
  • how to connect Docker containers without a bridge?
  • Kubernetes: Cannot deploy flask web app with apache and https
  • 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.

  • How are people authenticated in their ASP.NET Core Web APIs on Ubuntu/Docker given the bug described below?
  • In Docker, apt-get install fails with “Failed to fetch http://archive.ubuntu.com/ … 404 Not Found” errors. Why? How can we get past it?
  • Getting Mac address from Docker Container
  • How to configure docker to use /opt instead of /var
  • <CoreOS, cloud-config> How to 'Wait' until Docker Private Registry is ready?
  • is it a good practice to put a war file image into docker containers?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.