Lando: Connection to mysql via socket fails

Created on 29 Dec 2017  路  2Comments  路  Source: lando/lando

Bug Report

  • MacOS
  • Lando v3.0.0-beta.31
  • Docker

Client:
Version: 17.09.0-ce
API version: 1.32
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:40:09 2017
OS/Arch: darwin/amd64

Server:
Version: 17.09.0-ce
API version: 1.32 (minimum version 1.12)
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:45:38 2017
OS/Arch: linux/amd64
Experimental: false

Tell us about your .lando.yml

name: project
recipe: laravel

# Configure the laravel recipe
config:

  # See: https://laravel.com/docs/5.4/installation#server-requirements

  # Optionally specify the php version to use.
  #
  # If ommitted this will default to the latest php version supported by laravel.
  # Consult the `php` service to see what versions are available. Note that all
  # such versions may not be supported in Laravel 7 so YMMV.
  #
  # See: https://laravel.com/docs/5.4/installation#server-requirements
  #
  # NOTE: that this needs to be wrapped in quotes so that it is a string
  #
  php: '7.1'

  # Optionally specify whether you want to serve drupal via nginx or apache
  #
  # If ommitted this will default to the latest apache
  #
  # See: https://laravel.com/docs/5.4/installation#web-server-configuration
  #
  via: nginx

  # Optionally specify the location of the webroot relative to your approot.
  # For Laravel this is usually 'public'
  #
  # If ommitted this will be your approot itself.
  #
  webroot: public

Tell us about the command you were running

lando rebuild && lando mysql

Tell us about the error you got

Example:

lando mysql -vvvv

Results in

Starting project_database_1 ...
Starting project_database_1 ... done
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

Does this bug prevent you from using lando?

Yes, I can't connect to the database

How can I solve this issue, I think this might be a docker problem but could not find any solution :-(
(Sorry, I'm a stupid newbie and hoped lando will help me to use docker nevertheless)

can not replicate

Most helpful comment

while not ALWAYS the case this usually happens when you try to switch databases and is documented here
https://docs.devwithlando.io/issues/switching-dbs.html

All 2 comments

@psren thanks for the report.

This is working as expected for me. I tried the lando/examples/laravel with mariadb (the default) and with mysql in both cases lando mysql connected me to the DB sever correctly.

Are you using a default laravel install? if not could be something specific to your app configuration.

while not ALWAYS the case this usually happens when you try to switch databases and is documented here
https://docs.devwithlando.io/issues/switching-dbs.html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seanr picture seanr  路  4Comments

GhostInTheMachines picture GhostInTheMachines  路  3Comments

sarath49 picture sarath49  路  3Comments

ericpugh picture ericpugh  路  3Comments

eleftrik picture eleftrik  路  3Comments