-
Hi! I am developing on a Linux box. I am completely new to Symfony and am on my second day, following the tutorials on SymfonyCast. I am stuck at the following point: I have Apache and MySQL installed, so I am not using Docker. When I try to run either
or
I get
I even tried
on the command line, but
does not show DATABASE_URL. Any suggestions, how I should proceed? And no, installing and using Docker is not an option. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
After some more tinkering and researching I found the solution: Instead of
I had to write
Now it works. But why this was necessary, I don't understand, because both root@127.0.0.1 and root@localhost are in my mysql user table. |
Beta Was this translation helpful? Give feedback.
-
HI, With symfony 6.4 and php 8.2.14 I solved this problem. When starting a symfony project and creating the .env Before : DATABASE_URL="mysql://root:root@127.0.0.1:3306/app:!ChangeMe!?serverVersion=5.7.24" and it works with MAMP That's it, if it can be useful to others and not go around in circles for several days! |
Beta Was this translation helpful? Give feedback.
After some more tinkering and researching I found the solution:
Instead of
DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7&charset=utf8mb4"
I had to write
DATABASE_URL="mysql://db_user:db_password@localhost:3306/db_name?serverVersion=5.7&charset=utf8mb4"
Now it works. But why this was necessary, I don't understand, because both root@127.0.0.1 and root@localhost are in my mysql user table.