Unable to access db from website (credentials)

'Ello, wondering if anyone’s ever encountered this one:

Setup laravel forge on a vps from digital ocean, got it all deployed and the website works, but I cannot access my mysql db. It connects successfully but is trying to input the incorrect credentials for access. It’s attempting to connect with my previous login credentials from when I was developing locally. It’s using my old localhost instead of my new ip, old username, password, etc etc. I’ve updated the .env file and .env.example just to see if it’d change anything, and I’ve updated the config/database.php file to try to access it from env variables and I’ve also tried to hard-code it without success - Still tries to login with my old credentials. I couldn’t install my repo to my server via forge so may that have something to do with it? I’m at a loss for this one.

I’ve tried asking different laravel forums but had no avail, so hopefully someone here may have an answer.



This comment has been deleted

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @ryanpq:

Were you able to find those existing credentials anywhere in your deployed filesystem? The easiest way to get to the bottom of this might be to use grep to look recursively through your project and identify where the incorrect information is being loaded from. Something like

cd /your/project/directory
grep -r "somethingunique" .

Using the path to your project for the first command and a unique string (like the db user or password from your local testing) for the second command. This should result in a list of files with snippets showing the results in context and will allow you to find where these incorrect values are coming from.

View the original comment