I have a problem to execute this:
$ php artisan migrate
I'm getting an error
[PDOException]
SQLSTATE[HY000] [2002] Connection refused
I'm using MAMP and it's working ok.
I have tried to set the localhost to 127.0.0.1 and I've added 'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock'
but nothing helps.
[Edit] also I've added the port and I have checked the user and the password are correct and the server is running properly.. any suggestion??
Thanks
Not sure but make sure your mysql server
is running and it's running on the right port as expected because, Laravel
's default port value is 3306
(it's the default port of mysql
server) and most probably mysql
is running on a different port. Here is a discussion and also check this answer, it's almost similar.
Also follow this thread which discussed and solved the same error you mentioned in your question:
[SOLVED] SQLSTATE[HY000] [2002] Connection refused
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