SQLSTATE[HY000] [1045] Access denied for user ‘homestead’@’localhost’ (using password: YES)

laravel database username

SQLSTATE[HY000] [1045] Access denied for user ‘homestead’@’localhost’ (using password: YES)

This Laravel error is simply telling you that you may have used the wrong username in your .env file. You can edit the Laravel database configuration details in the .env file.

Step 1. Change Laravel Database Username

To change the database information for your Laravel project you should edit your .env file. The .env file for your project should be located in the base directory for your project.

laravel database config

Step 2. Restart the Artisan Server

sudo php artisan start

Leave a Comment

Your email address will not be published. Required fields are marked *