This question already has an answer here:
- Error #2002 Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2) 4 answers
- Yosemite - MAMP - Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2) 6 answers
- MAMP - phpMyAdmin #2002 - Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' 3 answers
I have a Laravel 5 app running that uses MySQL.
My app returns an error:
live.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)' in /var/www/app/admin/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:55
I researched but no solution did help.
- My MySQL server is running
- I can use the username and password used in Laravel to access de DB via phpMyAdmin On the same server I have some Wordpress pages (using MySQL) running without problems
- The file /var/run/mysqld/mysqld.sock exists, I ran chmod 777 to make sure enough rights are granted.
I don't think that this is a duplicate since my MySQL server is running and to me this seems to be a Laravel issue as described in my question.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire