1

I'm trying to make an auth api, but when I try to register a user this error appears in Postman:

Illuminate\Database\QueryException: SQLSTATE[HY000] [2002] No such file or directory (SQL: insert into users (name, email, password, updated_at, created_at) values (NomeTeste, teste, $2y$10$UwJfYrG2ugyAKVW1Hvjq7O1k51qfHYuF6F9abt56bg6Wrw7tEALIS, 2022-07-07 08:07:17, 2022-07-07 08:07:17)) in file /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 759

I tried changing my DB_HOST beetween localhost and 127.0.0.1, but when is 127.0.0.1 the error is "Connection Refused", and when is localhost the error is "No such file or directory" and the migrate gives this error:

SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = pontotel_cadastro and table_name = migrations and table_type = 'BASE TABLE')

I tried a lot of solutions that I found on the internet, but none of them helped me

  • check your MySQL status, is it running or not – Anuj Shrestha Jul 07 '22 at 08:15
  • Does this answer your question? [MySQL connection not working: 2002 No such file or directory](https://stackoverflow.com/questions/1676688/mysql-connection-not-working-2002-no-such-file-or-directory) – N69S Jul 07 '22 at 08:43
  • Did you try running this on a vanilla Laravel install? Seems like your `migration` table is not even there. – Aaron T Jul 07 '22 at 10:31

0 Answers0