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

后端 未结 30 2586
南方客
南方客 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条回答
  •  -上瘾入骨i
    2020-11-22 03:52

    If you are using Laravel Homestead, here is settings

    (include Vagrant-Virtual Machine)

    .bash-profile

    alias vm="ssh vagrant@127.0.0.1 -p 2222"
    

    database.php

        'mysql' => [
            'driver'    => 'mysql',
            'host'      => env('DB_HOST', '127.0.0.1'),
            'database'  => env('DB_DATABASE', 'homestead'),
            'username'  => env('DB_USERNAME', 'homestead'),
            'password'  => env('DB_PASSWORD', 'secret'),
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
            'strict'    => false,
        ],
    

    Terminal

    vm
    
    vagrant@homestead:~/Code/projectFolder  php artisan migrate:install
    

提交回复
热议问题