Yes, i followed the steps mentioned on the link you provided before & it did not work
I was able to figure out the way!!
The key is to not use localhost or 127.0.0.1 as IP but to find out the IP bound to the mysql docker container & use that.
Below are the steps to figure out the IP for mysql docker container
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
88f8a6baf98c openemr/openemr:5.0.1 “./run_openemr.sh” 2 months ago Up 4 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp lightsail_openemr_1
d05167f16b1f openemr/mysql-xtrabackup:latest “docker-entrypoint…” 2 months ago Up 4 hours 3306/tcp lightsail_mysql_1
So now we know the container id for mysql starts with d05167f16b1f*
Next we go to /var/lib/docker/containers/ and we will find dir which starts with d05167f16b1f*
We check hosts file in that directory & it will be something like below
::1 localhost ip6-localhost ip6-loopback
We need to use 18.104.22.168 as IP to connect to mysql & it works!