Error when trying to create doctrine database with phpMyAdmin

I’m a fresh junior php developper and I’m building my first Symfony project.

When I used the command : php bin/console doctrine:database:create
I get these errors :

In AbstractMySQLDriver.php line 93:
An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory

In PDOConnection.php line 31:
SQLSTATE[HY000] [2002] No such file or directory

In PDOConnection.php line 27:
SQLSTATE[HY000] [2002] No such file or directory*


I’m actually using MAMP with default config “db_user” and “db_password”
so I edited the .env file with this following code :
DATABASE_URL=mysql://root:[email protected]:8889/mydbname

I know there is something wrong with my host or port, I saw on other topics that some users using MAMP keep the symfony default values for host and port : DATABASE_URL=mysql://root:[email protected]:3306/mydbname

Thanks for reading me and trying to help me.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *