-1

I set up a laravel project. In the .env file i changed the DB name, username and password. When I try to connect to the DB with Mysql workbench, I can only connect with the original "homestead" username and the "secret" password. What have I done wrong?

user3322672
  • 153
  • 2
  • 13
  • Does this answer your question? [Laravel not reading changes to .env file](https://stackoverflow.com/questions/34420761/laravel-not-reading-changes-to-env-file) – miken32 Aug 04 '23 at 17:42

2 Answers2

1

Maybe you can try to clear your cache with these command before you test your app:

php artisan config:cache
php artisan config:clear
  • tried that. Does not work. Same result. If I test connection, I can only enter with default data. Not the new data. – user3322672 Apr 21 '20 at 15:19
0

You can't change the username and pw from the .env file.
You have to change it in mysql first and then write the new username and pw to the .env file, so the laravel project can communicate with the database.

I'm not a mysql expert but maybe this helps:
How to change USERNAME And PASSWORD of MySQL?