问题
I created two apps with Symfony. For these 2 apps, I can't connect to the databases with the same symptoms (timed out connection).
Information common to both apps
- Host : OVH
- subscription : gold created in octobre 2016
- Datacenter : Gravelines 1
- Version php 7.1 (but same in 7.2, I just changed to have the same as in dev environment)
App 1:
- Database supplied with the offer
- Phpmyadmin connection: OK
- PDO connection via test script: OK
- Line of the .env file:
DATABASE_URL = mysql: // nombase1: pwd@nombase1.mysql.db: 3306 / nombase1 serverVersion = 5.6?
- return error for doctrine:migrations:migrate
SQLSTATE [HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
App 2:
- Private sql database
- Phpmyadmin connection: OK
- PDO connection via test script: OK
- Line of the .env file:
DATABASE_URL = mysql: // nombase2: pwd@dmxxxxxx-001.privatesql: port / nombase2 serverVersion = 5.7?
- return error for doctrine:migrations:migrate
An exception occurred in driver: SQLSTATE [HY000] [2002] Connection timed out
These errors are probably trivial, but after a full weekend of research on the forums, various and varied tests and a call to the OVH hotline which refers me to the symfony hotline, I decide to open a post.
回答1:
For the first App it seems that you have miss configured the database connection, for the second App seems like the service is not running
来源:https://stackoverflow.com/questions/60038669/impossible-to-access-database-ovh-server