Alex Dai Playground

[Laravel] MAMP migrate error SQLSTATE[HY000] [2002] No such file or directory

| Comments

Add

'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',

config/database.php
     'mysql' => [
          'driver'    => 'mysql',
          'host'      => env('DB_HOST', 'localhost'),
          'database'  => env('DB_DATABASE', 'forge'),
          'username'  => env('DB_USERNAME', 'forge'),
          'password'  => env('DB_PASSWORD', ''),
          'charset'   => 'utf8',
          'collation' => 'utf8_unicode_ci',
          'prefix'    => '',
          'strict'    => false,
          'unix_socket'   => '/Applications/MAMP/tmp/mysql/mysql.sock',
      ],

Comments

comments powered by Disqus