Comments (6)
Thanks @silverbackdan for the answer 😃
The issue seems to be fixed, let's close it
from symfony-docker.
Thank you so much @silverbackdan for your help
from symfony-docker.
In your DATABASE_URL try:
mysql://root:root@mysql:3306/mystore?serverVersion=5.7
the format is
mysql://username:password@host:port/database?serverVersion=x.x
- in docker the host can be referred to by the service name
You should really define the MYSQL_USER
and MYSQL_PASSWORD
variables and use those instead though instead of the root user.
Are you aware you have both a mariadb and a mysql database service?
from symfony-docker.
thank you @silverbackis yes i do i tried with mariadb and when it failed i used mysql service
from symfony-docker.
Hey @silverbackdan thank you so much i fixed the Error its really silly but its appair very complicated when we dont know from where comes .
The problem is missing the single quotes only
mysql:
image: mysql:8.0
container_name: mystore-mysql
working_dir: /application
volumes:
- .:/application
environment:
- MYSQL_ROOT_PASSWORD= 'root'
- MYSQL_DATABASE= 'mystore'
- MYSQL_USER= 'root'
- MYSQL_PASSWORD= 'root'
ports:
- "3308:3306"
.env file :
DATABASE_URL=mysql://root:root@mysql:3306/mystore?serverVersion=5.7
i have only one question please if you could respond me
if put the variables instead where i should put my credentials
mysql:
image: mysql:8.0
container_name: mystore-mysql
working_dir: /application
volumes:
- .:/application
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
from symfony-docker.
You should choose a different username for your MYSQL_USER other than root
- that should be used for a root user.
You may not need the quotes if you do not have a space either. Alternatively you can format like your second example using colons instead of the equals sign.
For your second example you can use it as you have shown or by simplifying it further
environment:
- MYSQL_ROOT_PASSWORD
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
Further reading: https://docs.docker.com/compose/environment-variables/
This will do the same thing and pass your system environment variables to the docker container.
You can either setup your system environment variables or create a .env
file in the project's root directory (the same directory as the docker-compose.yaml
file). Then when you run docker-compose up
from the project root directory, that .env
file will be used.
from symfony-docker.
Related Issues (20)
- cdn.jsdelivr.net importmap:install ERROR Curl HOT 4
- invalid interpolation format for services.php.environment.TRUSTED_HOSTS HOT 1
- Too stupid for recipes HOT 4
- Is mecure required for production? HOT 1
- Unable to connect to external database HOT 1
- Could this repo be converted to a symfony recipe? HOT 1
- Unable to boot app in production mode HOT 2
- Large number of entities cause ORM mapping to break HOT 9
- .env.prod.local not picked up on docker compose up HOT 4
- Unable to deploy in production HOT 3
- invalid interpolation format for services.php.environment.TRUSTED_HOSTS HOT 1
- Informations about my github ci file HOT 1
- Serving Symfony Welcome Page with Docker Compose Opens phpinfo() Instead HOT 2
- Cannot install some PHP extention HOT 1
- Docker escape error HOT 1
- container no run
- Mariadb Connexion lost HOT 5
- Symfony hanging every now & then HOT 17
- Unable to start existing project
- Franken crash HOT 7
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 symfony-docker.