I created an .env file in the root of the project. There I have these entries:

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=mypassword

```

In config/database.php I have this that I guess is set by default by laravel:

```
'mysql' => [
        'driver' => 'mysql',
        'url' => env('DATABASE_URL'),
        'host' => env('DB_HOST', '127.0.0.1'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'forge'),
        'username' => env('DB_USERNAME', 'forge'),
        'password' => env('DB_PASSWORD', ''),

```

When I run artisan to execute migration, with

```
php artisan migrate:fresh

```

I can see that my local database has been filled with tables.

What I do next is to request a creation of a user, with Auth located in /Http/Controllers/Api/AuthController.php.

However, I got an error saying:

```
SQLSTATE[HY000] [1045] Access denied for user 'root'@'IP_ADDRESS' (using password: YES) (SQL: select count(*) as aggregate from `users` where `email` = myemail@mail.com)

```

Why? Isn't it enough to have an .env with my local settings? I cannot understand where the ip address comes from. I searched all the project but the IP does not exist in the code.

A local form in a view goes to

```
http://localhost:8204/register

```

This is picked up in

```
routes/api.php

```

with this declaration:

```
Route::post('/register', [\App\Http\Controllers\Api\AuthController::class, 'register']);

```

The error above is printed by this file:

```
vendor/laravel/framework/src/Illuminate/Database/Connection.php:692

```