RedpointArchive / phabricator

A Docker image that runs Phabricator, an open source software engineering tool
https://hub.docker.com/r/redpointgames/phabricator/
307 stars 98 forks source link

External mysql not working? #36

Closed victornoel closed 8 years ago

victornoel commented 8 years ago

Hi,

I tried to run phabricator with mysql setup on the host, so I used the following options:

    --env MYSQL_HOST=localhost \
    --env MYSQL_USER=phab \
    --env MYSQL_PASS=phab \
    --env MYSQL_PORT=3306 \

But when the start script run, I get the following error:

+ mysqlcheck --host=localhost --port=3306 --user=phab --password=phab --databases phabricator_search
/
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory") when trying to connect

I guess this should not happen, right?

hach-que commented 8 years ago

localhost inside the container will be pointing to the container. You need to give the Docker gateway address I think.

On Fri., 1 Jul. 2016, 9:15 pm Victor Noël, notifications@github.com wrote:

Hi,

I tried to run phabricator with mysql setup on the host, so I used the following options:

--env MYSQL_HOST=localhost \
--env MYSQL_USER=phab \
--env MYSQL_PASS=phab \
--env MYSQL_PORT=3306 \

But when the start script run, I get the following error:

  • mysqlcheck --host=localhost --port=3306 --user=phab --password=phab --databases phabricator_search / mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory") when trying to connect

I guess this should not happen, right?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hach-que-docker/phabricator/issues/36, or mute the thread https://github.com/notifications/unsubscribe/AAez-pHSPRUaOpld0ugM_cijhGhllM9Pks5qRPa_gaJpZM4JDDVi .

victornoel commented 8 years ago

Ha! Sorry and thanks :)

strahe commented 8 years ago

@hach-que Hi, i use the docker-compose, and got the same error.I did not change anything except PHABRICATOR_HOST, any ideas?

hach-que commented 8 years ago

What's the content of the startup log? What address is it trying to connect to?

strahe commented 8 years ago

@hach-que I configured the PHABRICATOR_HOST to 192.168.1.8

+ sudo -u git ./bin/config set notification.servers '[{"type": "client","host": "192.168.1.8","port": 80,"protocol": "http","path": "/ws/"},{"type": "admin","host": "127.0.0.1","port": 22281,"protocol": "http"}]'
Set 'notification.servers' in local configuration.
+ unset APHLICT_PROTOCOL
+ unset APHLICT_PORT
+ popd
+ '[' '' == true ']'
+ '[' '' '!=' '' ']'
+ mysqlcheck --host= --port= --user=phabricator --password=phabricator --databases phabricator_search
/
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory") when trying to connect
+ true
+ /srv/phabricator/phabricator/bin/storage upgrade --force
MySQL Credentials Not Configured
Unable to connect to MySQL using the configured credentials. You must
configure standard credentials before you can upgrade storage. Run these
commands to set up credentials:
  phabricator/ $ ./bin/config set mysql.host __host__
  phabricator/ $ ./bin/config set mysql.user __username__
  phabricator/ $ ./bin/config set mysql.pass __password__
These standard credentials are separate from any administrative credentials
provided to this command with __--user__ or __--password__, and must be
configured correctly before you can proceed.
Raw MySQL Error: Attempt to connect to phabricator@localhost failed with
error #2002: No such file or directory.
[ FAILED ] /etc/init.simple/10-boot-conf
hach-que commented 8 years ago

It looks like this might be the issue:

https://github.com/docker/compose/issues/2332#issuecomment-179538205

We don't use hostnames yet for connecting to a linked MySQL container, so if you're running Docker 1.10 or later linking probably won't work for you.

I'll see if I can get some time to look at this next week unless someone wants to send through a PR before then.