• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home » Resolved: How to connect to Docker DB (Laravel with ddev and MySQL)

Resolved: How to connect to Docker DB (Laravel with ddev and MySQL)

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have a Laravel project where I have to connect to a MySQL db. I deployed the project with ddev, so I´m using docker. The .env file have this credentials:
With this configuration, I can do migrations, and all goes in the right way, but HOW can I see this database? Can I link a DB which is in my local MySQL server? For example, Can I change this host for localhost and set a DB created by me?
I really don´t know why this works, so if somebody helps me, I will be thankfull.

Answer:

You can explore your database in so many different ways:
  • ddev mysql
  • ddev launch -p (or click the link in ddev describe to use PhpMyAdmin
  • Use the mysql client in either web container or db container

You can export the database to text format with ddev export-db or make a binary snapshot with ddev snapshot.
There’s lots more detail and more options for database browsers at https://ddev.readthedocs.io/en/latest/users/topics/database_management/

If you have better answer, please add a comment about this, thank you!

ddev docker laravel php
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Unable to run Docker .NET 6 console image

02/04/2023

Resolved: Input Focus between two React Components

02/04/2023

Resolved: linq2db throws exception when filtering by nested collection

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.