Answer the question
In order to leave comments, you need to log in
How to fix Access denied for user... error in laravel homestead?
Laravel throws an error when trying to migrate to the framework
[PDOException]
SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost' (usin
g password: YES)
APP_ENV=local
APP_DEBUG=true
APP_KEY=JLCGJP1CiFpI24q50pZAZOTNRcl1eRCr
DB_HOST=127.0.0.1
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
Answer the question
In order to leave comments, you need to log in
Look at the settings in the config\database.php file:
'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', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question