Impossible to access database (OVH server) [closed]

北城以北 提交于 2020-02-08 11:07:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!