@startuml
digraph G {
rankdir=LR
symfony [label="Symfony", shape=oval]
mysql [label="MySQL", fillcolor=lightblue, style=filled, shape=cylinder]
symfony -> mysql
}
@enduml
sudo apk add mysql
sudo apt install mysql-server
sudo yum install mysql-server
MySQL is preconfigure, and in most cases, default configurations is enough.
You need to tell symfony where to find the database.
You have two options: use Environment variable, use dotenv
file.
Edit your HTTP server configuration to add environment variable
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7
At the project root create/edit the file .env.local
and add the following line:
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7