Please find attached example as requested in order to reproduce the issue. (It wont allow me attach anything, ill send it to you via email!)
Having another issue from your site too regarding Seamless Docker Multihost Overlay Networking on DigitalOcean With Machine, Swarm, and Compose ft. RethinkDB
@pedro47, I have remote connection from a mysql client on my OSX machine working to a container inside the Docker Machine VM, here’s what I did to get it to work.
As also indicated by that link, once I ran the container with the new configuration image I did a docker exec and ran some SQL to grant privileges to root user enabling remote connection. SELECT User, Host FROM mysql.user WHERE Host <> 'localhost' indicated a root user allowed to connect from everywhere, so I followed up with:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
Then, I was able to connect with MariaDB client on my Macbook. The port is arbitrary due to my use of docker run -P but you should be able to connect to 3306 if that’s the one you’re exposing.
$ mysql -h $(docker-machine ip) -P 32768 -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.1.13-MariaDB-1~jessie mariadb.org binary distribution
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
MariaDB [(none)]>
Remember, this will expose the database to connection from all places, you should be careful to lock this down more carefully if you end up moving it into higher environments.