I am trying to set up migrations for the first time and when I run
php artisan migrate:install
from within the root folder of my project I get the following SQLSTATE error:
SQLSTATE[HY000] [2002] No such file or directory
I have tested running mysql
to make sure it is working and referenced and I have ran php artisan help:commands
to make sure artisan is working (it is).
The website itself is functioning and reading from the database fine.
This may be an issue with the sockets if you're using MAMP or XAMPP.
From http://forums.laravel.io/viewtopic.php?id=980...
'connections' => array(
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
'database' => 'database',
'username' => 'user',
'password' => 'pass',
'charset' => 'utf8',
'prefix' => '',
),
),
You can pass an optional "unix_socket" to the array and specify the MAMP socket instead of the default location.
Also, try and change 'host' => 'localhost', to 'host'=> '127.0.0.1', because unix does not recognise 'localhost'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With