SQLSTATE[HY000] [2002] Connection refused on shared hosting
I connect with vanilla php statement on shared hosting and on the local machine to that machine.
But it doesn't work my shared hosting.
DB_CONNECTION=mysql
DB_HOST=mysql.loopia.se
DB_PORT=3306
DB_DATABASE=databasename
DB_USERNAME=username
DB_PASSWORD=password
Are you using an external db or is the db host mysql.loopia.se on the same server as your application ?
@gych I don't know. I tried it as extrenal db and it works in pure php but not in laravel
@BlueSilver When you tried it with vanilla php, was that on the same server you can't make the connection with laravel ?
@gych I tried it on shared hosting with vanilla php and it works. It is with Laravel that is not working.
@BlueSilver Try to run php artisan config:clear to clear the cached config.
@Tray2 I'm not. I tried in pure PHP. It worked on server.
Did you tried to connect in SQL via command line? Maybe you have a mistake in DB_HOST variable.
Please or to participate in this conversation.