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

后端 未结 30 3014
南方客
南方客 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:39

    Building on the answer from @dcarrith ...

    Instead of editing the config files, I created an alias in the location that PHP is looking that connects to the real mysql.sock. (source)

    Just run these two commands (no restart needed):

    mkdir /var/mysql
    ln -s /tmp/mysql.sock /var/mysql/mysql.sock
    

提交回复
热议问题