assetto-corsa-web / acweb

Assetto Corsa Server Management Tool via Web Interface.
MIT License
58 stars 9 forks source link

Strange Db issue #49

Closed gabroid closed 6 years ago

gabroid commented 6 years ago

Hi, first of all thanks for your work :) I trying to install this web ui but when i launch the command guide i reach an error in logs: time="2018-08-21T01:31:15Z" level=info msg="Connecting to 'mysql' database 'acweb' at 'tcp(127.0.0.1:3306)'" time="2018-08-21T01:31:15Z" level=fatal msg="Error connecting to database" err="dial tcp 127.0.0.1:3306: getsockopt: connection refused"

the command i use is :

sudo docker run -d -p 80:8080 -p 9600:9600/tcp -p 9600:9600/udp -p 8081:8081 --name acweb \ -e ACWEB_DB_TYPE=mysql \ -e ACWEB_DB_USER=acweb \ -e ACWEB_DB_PASSWORD=password \ -e ACWEB_DB_HOST="tcp(127.0.0.1:3306)" \ -e ACWEB_DB=acweb \ -v /root/steam/assetto/uuu:/root/steam/assetto/ \ -v /log/dir/path:/logs \ kugel/acweb i cleared user and pasword here.

user is allowed to access from anywere (%) can't understand why my sql deny the access..

ac installation path on linux server is /root/steam/assetto/

thanks for your help :) have a nice day

gabroid commented 6 years ago

just for info i solved changing the localhost with this address -e ACWEB_DB_HOST="tcp(172.17.0.1:3306)"

seems that the istance on docker cant see the right localhost. please fix the guide :)

Kugelschieber commented 6 years ago

From the docker installation instructions:

This will use a MySQL database installed on your host machine. To use a MySQL database running in a container, please rever to the official MySQL image. You have to use Dockers --link option to access it, if you don't expose the MySQL port.

cheesegrits commented 5 years ago

@Kugelschieber I have to agree with the OP on this one. Using 127.0.0.1 from the container doesn't access the host, it accesses the container. That would only work with the network=host option, which then discards published port mappings, and directly opens the container's ports on the host.

Maybe it a Docker version or platform thing, I'm running 180.06 on Ubuntu. I wound up doing this:

docker run -d \ --name acweb \ --network=host \ -e ACWEB_DB_TYPE=mysql \ -e ACWEB_DB_USER=root \ -e ACWEB_DB_PASSWORD="secret" \ -e ACWEB_DB_HOST="tcp(127.0.0.1:3306)" \ -e ACWEB_DB=acweb \ -v /home/assetto/assetto:/ac \ -v /home/assetto/logs:/logs \ kugel/acweb