php - Symfony error : Cannot connect to DB after DB update -
i had symfony 2 website connected mysql db, find, after changing contract host provider, needed tu update datas on new db, new names. created new db, php myadmin shows me fine on side.
i updated paramaters.yml file follow in symfony project:
parameters: database_host: newdbhostname.db.1and1.com database_port: 3306 database_name: newdbname database_user: newdbusername database_password: ********** mailer_transport: mail mailer_host: null mailer_user: null mailer_password: null secret: *sameasbefore*
but since then, cannot connect db, , have weird error:
warning: pdo::__construct(): php_network_getaddresses: getaddrinfo failed: name or service not known in /homepages/37/d627732413/htdocs/billetterielouvre/vendor/doctrine/dbal/lib/doctrine/dbal/driver/pdoconnection.php on line 43
this part corresponds to:
public function __construct($dsn, $user = null, $password = null, array $options = null) { try { line 43 --> parent::__construct($dsn, $user, $password, $options); $this->setattribute(pdo::attr_statement_class, array('doctrine\dbal\driver\pdostatement', array())); $this->setattribute(pdo::attr_errmode, pdo::errmode_exception); } catch (\pdoexception $exception) { throw new pdoexception($exception); } }
i cleared cache through ssh on server, still error happens. have idea me find needs fixes there ?
thanks!
you should clean cache.
rm -rf app/cache/*
does new provider allow connecting external networks?
try creating script in plain old php , see if can connect
with ssh on server, can resolve host of db? try nslookup newdbhostname.db.1and1.com
, telnet newdbhostname.db.1and1.com 3306
Comments
Post a Comment