Comments (3)
Submitted a pull request to solve this.
from homestead-docker.
@dydx Thanks, Referencing DB credentials directly in the .env file will work just fine, you won't be forced to use the same environment names in your production app.
Anyway, Merging!
If you want to do it my way then use this:
DB_HOST = 172.17.42.1 ( see bellow )
DB_PORT = 3306 ( or custom port )
DB_NAME = db_name ( you should create it first )
DB_USER = admin ( cannot be changed )
DB_PASSWD = root ( same as docker_compose.yml file )
Sometimes, the connection does not work with 127.0.0.1 or localhost, you should use docker's internal IP, for me it's 172.17.42.1, it should be the same for you. Ifconfig to find it.
from homestead-docker.
That way works, but as you mentioned the IP is subject to change.
Now that the web container and the database container are linked, you can use the more idiomatic way of just specifying:DB_HOST = mariadb
and it'll work between builds with no issue of IP reassigning.
from homestead-docker.
Related Issues (20)
- Is is possible to change the PHP version? HOT 1
- 413 Request Entity Too Large HOT 2
- How to connect MySQL WorkBench HOT 9
- Slow Mysql HOT 1
- SOAP missing HOT 1
- MongoDB HOT 1
- cant run serve.sh: permission denied HOT 2
- phpmyadmin HOT 2
- PHP 7.2 like in latest Homestead? HOT 1
- HTTPS for homestead HOT 1
- can you give me some example? HOT 1
- How to connect on mysql? HOT 2
- Upgrade PHP 7.2 HOT 2
- Nginx Sites-enabled problem HOT 2
- How to add Xdebug?
- homestead:php7.1 is running php 7.3.3 HOT 3
- Can`t connect to server : the connection was reset HOT 1
- Ubuntu 18.04 is there a plan to update? HOT 1
- Hello! HOT 3
- How to connect to database? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homestead-docker.