0

I have a naked installation of the newsest Lumen version.

php artisan migrate

results in the following error:

enter image description here

enter image description here

rakete
  • 2,953
  • 11
  • 54
  • 108
  • Possible duplicate of [PHP - MySQL connection not working: 2002 No such file or directory](http://stackoverflow.com/questions/1676688/php-mysql-connection-not-working-2002-no-such-file-or-directory) – Maraboc Aug 08 '16 at 18:37
  • 1
    @Maraboc I actually disagree. While the underlaying issue is the same, Lumen as a framework has a specific way of handling this. Nothing in that post addresses where in Lumen you would have to make that change. – Ohgodwhy Aug 08 '16 at 18:42

2 Answers2

4
DB_HOST=127.0.0.1

instead of

DB_HOST=localhost

solved the problem!
rakete
  • 2,953
  • 11
  • 54
  • 108
0

Issue is less to due with Lumen and more to do with your environment. That specific PDO error indicates that your connection factory has a bad reference to the unix socket location.

Lumen is smart, however, and knows that this can be a problem. Open your database configuration and give it a default socket path:

'mysql' => [
     //....
     'unix_socket'   => '/Full/Path/To/mysql/mysql.sock',
]
Ohgodwhy
  • 49,779
  • 11
  • 80
  • 110