chaevnicher's avatar

PDOException SQLSTATE[HY000] [2002] No such file or directory

(1/2) PDOException SQLSTATE[HY000] [2002] No such file or directory

(2/2) QueryException SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from users where login = login123 and password = 9bf80e4a557e7a69c29d1580d240a1f0 and active = 1 limit 1)

class User extends Illuminate\Database\Eloquent\Model;
...
$user = User::where('login', $login)
            ->where('password', $password)
            ->where('active', 1)
            ->first();

Hello, I used lumen, macosx, brew mysql... .env -> DB_HOST=127.0.0.1 mysql> show variables like '%sock%';

+-----------------------------------------+------------------+
| Variable_name                           | Value            |
+-----------------------------------------+------------------+
| mysqlx_socket                           | /tmp/mysqlx.sock |
| performance_schema_max_socket_classes   | 10               |
| performance_schema_max_socket_instances | -1               |
| socket                                  | /tmp/mysql.sock  |
+-----------------------------------------+------------------+

ps: artisan worked ok.

0 likes
1 reply

Please or to participate in this conversation.