Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' #27

Closed
Ridder90 opened this issue Sep 14, 2017 · 2 comments
Labels

Comments

@Ridder90
Copy link

Ridder90 commented Sep 14, 2017

Hi there,

Not sure if this is the right place but I can't seem to connect to mysql when using this image. This my compose file:

https-portal:
  image: steveltn/https-portal
  ports:
    - 80:80
    - 443:443
  links:
    - wordpress
  environment:
    STAGE: local
    DOMAINS: 'dev.drc.nl -> http://wordpress'
wordpress:
  image: wordpress:php7.1
  links:
    - db:mysql
  environment:
    MYSQL_ROOT_PASSWORD: admin
    MYSQL_DATABASE: wordpress
  volumes:
    - ${PWD}/html:/var/www/html
db:
  image: mysql:latest
  environment:
    MYSQL_ROOT_PASSWORD: admin
adminer:
      image: clue/adminer
      links:
        - db:mysql
      ports:
        - 8181:80

When trying to login i get Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

@Ridder90
Copy link
Author

For somebody reading this. i fixed this by specificly naming the db image

db:
  image: mariadb:latest
  container_name: db
  environment:
    MYSQL_ROOT_PASSWORD: admin
adminer:
  image: adminer
  links:
    - db:3306
  ports:
    - 8080:8080

Glad it works now :)

@clue
Copy link
Owner

clue commented Sep 15, 2017

Glad you've got this sorted out and thanks for reporting back and sharing with others! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants