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
or php artisan db:seed
) I get an error message:
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
At some point the migration must have worked, because my tables are there - but this doesn't explain why it isn't working for me now.
All these answers seem like heavy lifting...
I just created a
.env
file; edited mybootstrap/app.php
file, and uncommented the following line...Dotenv::load(__DIR__.'/../');
Hope this helps someone
Attempt to connect to localhost:
Attempt to connect to 127.0.0.1:
OK, just comment / remove the following setting from my.cnf (on OS X 10.5:
/opt/local/etc/mysqlxx/my.cnf
) to obtain:Of course, stop and start MySQL Server.
Step 1
Find the path to your unix_socket, to do that just run
netstat -ln | grep mysql
You should get something like this
Step 2
Take that and add it in your unix_socket param
Hope it helps !!
The answer from @stuyam solved the "No such file or directory" issue for me
But then I had a "Connection refused" error. If anyone had the same issue, my solution for this was to update the app/config/local/database.php file so the port is 8889: