why is my laravel can't detect to my database on localhost

55 views Asked by At

My project won't detect my database on localhost. If I test my database connection it will show "can't connect". No matter how many times I ask chatGPT I still can't solve this nonsense problem.

I already changed from XAMPP to Laragon but the problem is still there - I get a pop out messege that said "unable to connect". I already made multiple changes to env and database.php files, reviewing them line by line but have seem no problem.

the screenshot of the pop messege

1

There are 1 answers

0
Amin Elhan On

You should setting the port, database, username , and password in .env file with correct setting. It means you should have user to access database and the database