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
,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