Open anchetaWern opened 2 years ago
Your env is off :) https://docs.lando.dev/config/laravel.html#environment-file
DB_CONNECTION=mysql
DB_HOST=database //this as its inside docker
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=laravel
DB_PASSWORD=laravel
Also be aware that the root is /app
on docker, so you have set your webroot to /app/app/public
(unless laravel is in a subdirectory of course)
webroot: ./public
thanks! that worked. Will now try this out on an ubuntu and windows virtual machine so we could adapt lando for our team.
Your env is off :) https://docs.lando.dev/config/laravel.html#environment-file
DB_CONNECTION=mysql DB_HOST=database //this as its inside docker DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=laravel DB_PASSWORD=laravel
Also be aware that the root is
/app
on docker, so you have set your webroot to/app/app/public
(unless laravel is in a subdirectory of course)webroot: ./public
Its not working for me, I have used this same method but getting error *`SQLSTATE[HY000] [2002] Connection refused (SQL: select from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')`**
Please guide. Thanks
thanks! that worked. Will now try this out on an ubuntu and windows virtual machine so we could adapt lando for our team.
Could you please share your solution here for help. Thanks.
I am on MAMP. I Just changed the port to 8889 and the password to root. It works php artisan config:cache php artisan cache:clear php artisan migrate
I'm just trying out Lando for the first time using the Laravel recipe, but so far mysql is a headache. I can't seem to get it to work using this config:
For context, I tried creating a database using the mysql on the host machine then exported it using table plus. Then I imported it to the lando app using
lando db-import my_database.gz
. I was able to connect to the database externally via tableplus by entering the following credentials:laravel
laravel
laravel
But from within the app itself all I get is 'connection refused'. Here's my
.env
file:There weren't any privileges attached to the database (not even sure if those comes along with exports). I checked the actual export file and all it has is
CREATE
,DROP
, andINSERT
calls so it's supposed to just work without me granting privileges or anything.Any ideas what I might be missing?