OneZoom / OZtree-docker

A set of scripts that generate a fully functional docker image of the OneZoom software
Other
3 stars 1 forks source link

More info needed for connecting to mysql #2

Closed ocourch closed 2 years ago

ocourch commented 2 years ago

Attempting to connect to the Mysql instance from outside the container isn't working. I'm using the specified port but get the following error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I tried using the mysqld.sock that Docker owns, but that failed as well:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/snap/docker/common/var-lib-docker/overlay2/83dd9263ca23db83a8354d85ecb15e030c9e67d0d564605bbdae' (2)

Here's the command I'm using, with the password field filled in:

mysql --port=3306 --user=oz --password=<>

hyanwong commented 2 years ago

How are you running the docker container? In case you are already running something on 3306, you could try exposing it on (say) 3307:

docker run -p 8080:80 -p 3307:3306 --name running_onezoom onezoom/oztree-complete

Then wait for 5 mins and try e.g.

mysql --port=3307 --user=oz --password=passwd --host 127.0.0.1
ocourch commented 2 years ago

thanks! I think this is working now