5 years ago

Correct method to specify a port number

Posted 5 years ago by Snapey

I have local development environment using MAMP. The mysql port is 8889.

If I specify in my .env file DB_HOST = localhost:8889 then migrations work fine, but when accessing the database through my model, laravel complains that it cannot find the database.

So I change .env file so that DB_HOST = localhost and DB_PORT specifies 8889. Then in my app/config/database.php I add a line for port and pull in DB_PORT

This now works fine for my eloquent queries, but now migrations fail using Artisan.

Any suggestions about the correct way to specify non-standard port?

Please sign in or create an account to participate in this conversation.