0
votes

I'm having an issue trying to do a migration using the command line: php bin/console doctrine:migrations:migrate First of all: - I'm using symfony 4 in a group project on github - I'm using a mac and MAMP while other peeps from my group are using PCs and xampp

I'm pretty new to symfony 4 and github so I wouldn't be surprised if the solution was obvious. So I cloned the project and used the php bin/console doctrine:database:create command line to have my database up and running. However, I got an error message and after searching quite a bit, can't understand where the issue comes from:

MacBook-Pro-de-Jeremy:globetriber jeremystephens$ php bin/console doctrine:database:create 2018-02-18T17:18:58+01:00 [error] Error thrown while running command "doctrine:database:create". Message: "An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused"

In AbstractMySQLDriver.php line 108: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused

In PDOConnection.php line 47: SQLSTATE[HY000] [2002] Connection refused

In PDOConnection.php line 43: SQLSTATE[HY000] [2002] Connection refused

Let me know if you need any other information, thanks in advance for the help!

1
Googling SQLSTATE[HY000] [2002] Connection refused shows a ton of answers, did you try them?u_mulder
Yes I did but most of them refer to older versions of symfony which don't seem to be handled in the same way, for instance they refer to a parameters.yml file which doesn't exist anymore on symfony 4jerephens
I suppose there's some replacement for parameters.yml, isn't it?u_mulder
I haven't found the answer to this yet. I ran some modifications/tests to the .env and the doctrine.yaml files but nothing changed/workedjerephens
Ok, turns out with MAMP, the Mysql port is on 8889 so I modified the .env URL: DATABASE_URL=mysql://root:[email protected]:8889/globetriber and it worked !jerephens

1 Answers

0
votes

perhaps you must make sure the configuration of databasa is right documentation

in your .env file :

customize this line!

DATABASE_URL="mysql://db_user:[email protected]:3306/db_name"