dimanche 16 février 2020

Laravel 5.8 error SQLSTATE[HY000] [1045] Access denied for user 'username'@'xx.xx.xx.xx' (using password: YES)

I am facing a very strange issue with laravel 5.8. I have my database info in my .env as follows:

DB_CONNECTION=mysql
DB_HOST=xx.xxx.xxx.xxx
DB_PORT=3306
DB_DATABASE=crm2
DB_USERNAME=subscription
DB_PASSWORD=blah

I am doing my development on virtual box linux machine. When I run the following command on Artisan tinker,

App\Account::where('sic_code', '1101887931')->first();

I get the error

Illuminate/Database/QueryException with message 'SQLSTATE[HY000] [1045] Access denied for user 'subscription'@'ip-of-my-host-laptop' (using password: YES) (SQL: select * from `accounts` where `sic_code` = 1101887931 limit 1)'

Notice that the error above is referencing the IP address of my host laptop and not the DB_HOST in my .env.

I have tried various solutions here such as clearing cache, clear-compiled, restarting the server, etc with no success. Please help



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2UVVXc1
via IFTTT

Aucun commentaire:

Enregistrer un commentaire