Closed Skaywalker closed 7 months ago
@Skaywalker
Yes, you've to set the DB_HOST
to db
. It's written in the .env.example
https://github.com/refactorian/laravel-docker/blob/95797abd4fcce23407436199c58389c07cfa8a5b/.env.example#L22-L27
MySQL is in the db
container.
Run docker compose exec db bash
to access it.
Once you're inside the container you can access MySQL from there.
mysql -urefactorian -p Enter password: (refactorian) mysql> SHOW DATABASES;
Sorry, I still have a little problem. When I migrate the database, I find that the migration is running. But the page is connected to the database. but if I replace DB-HOST with db, the page runs. But then I can't use the database from my terminal. I have already added the network settings so that docker can work as a bridge.
Thank you in advance for your help.