PDOException SQLSTATE[HY000] [2002] No such file or directory

后端 未结 30 2581
南方客
南方客 2020-11-22 03:23

I believe that I\'ve successfully deployed my (very basic) site to fortrabbit, but as soon as I connect to SSH to run some commands (such as php artisan migrate

30条回答
  •  忘了有多久
    2020-11-22 03:50

    Add mysql.sock path in database.php file like below example

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

    Eample

    'mysql' => [
            'driver' => 'mysql',
            'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
            'host' => env('DB_HOST', 'localhost'),
            'port' => env('DB_PORT', '8889'),
    

提交回复
热议问题