PaoloYumul
2 years ago

Can't migrate in Digital Ocean

Posted 2 years ago by PaoloYumul

Hello,

When I try to run 'php artisan migrate' for the first time, I get this error:

[Illuminate\Database\QueryException]
  SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) (SQL: select * from information_schema.tables where table_schema = mydatabasenamehere
  and table_name = migrations)
[PDOException]
  SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

I tried restarting apache and clearing the config.

Here is my database.php and .env file:

'mysql' => [
            'driver' => 'mysql',
            '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', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mydatebasehere
DB_USERNAME=root
DB_PASSWORD=mypasswordhere

Hope you can help me with this.

Please sign in or create an account to participate in this conversation.