This is a strange one I've never been able to solve ever since I started using Laravel.
When I issue artisan-commands like 'php artisan migrate' in my db-config (I'm using MySQL via MAMP) the host line has to be:
'host' => 'localhost:8889',
However when loading a page in the web-browser I get:
SQLSTATE[HY000] [2005] Unknown MySQL server host 'localhost:8889'
It magically works when I change it to:
'host' => 'localhost',
On the live-server I'm running the application on I don't have this problem. What is going wrong here?
The default port that MySQL listens on is 3306
Likely you have one server where the port has been changed to 8889, when you remove that from your host string it uses the 3306 default and works.
I think there is a way to define production and dev values so you can define both and it will work on both servers.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community