Saturday, March 18, 2017

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

I am fairly new to Laravel framework. I keep getting this error when trying to register a user. I am able to do table migration so I know the connection works.Below is the info I have in my .env file. I am able to successfully migrate too, check below.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=classified
DB_USERNAME=root
DB_PASSWORD=null

The database also holds the migrated SQL files. So the connection works, however actually trying to register or login throws that error.

1/2
PDOException in Connector.php line 68:
SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)

2/2
QueryException in Connection.php line 647:
SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select count(*) as aggregate from `users` where `email` = user@gmail.com)

I am using MySQL and not using Homestead.I do not know where exactly it's getting the information from that it's trying to use, but if its not from the .env. This is a new install made minutes ago. All I did was enter the MySQL data in, perform auth, migrate to register. I am using Laravel 5.4



via Krishneil

Advertisement