Laravel error: Illuminate\Database\QueryException SQLSTATE[HY000] [2002] No such file or directory

This error happens when you move laravel files to the shared server from your local environment.

Just by removing the unix socket value in the database.php fixed issue for me.

 'unix_socket' => env('DB_SOCKET', '3306') is replaced by  'unix_socket' => env('DB_SOCKET', ''),


Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from `users` where `email` = myemail@gmail.com limit 1)

Comments

Popular Posts