eZ Community » Forums » eZ Publish 5 Platform » Unable to connect to the database...

Unable to connect to the database server after upgrading to EZ5.3/CP2014.03

Unable to connect to the database server after upgrading to EZ5.3/CP2014.03

Friday 23 May 2014 3:28:18 pm - 2 replies


I just upgraded my current project from Community Project 2014.01 to 2014.03.Of course I changed the config files as described in the upgrade docs.

This site is using Postgres, so I had to apply/backport this patch to fix the SQL syntax error that appeared when I finally wanted to clear the cache. Now, clearing the cache is running fine (and obviously using the correct database connection).

But when I finally try to access the site in my browser, I get the following exception:

Fatal error:  Uncaught exception 'eZDBNoConnectionException' with message 'Unable to connect to the database server 'localhost'

Error #1045: Access denied for user '*****'@'localhost' (using password: YES)' in [...]/ezpublish_legacy/lib/ezdb/classes/ezmysqlidb.php:135

Stack trace:

#0 [...]/ezpublish_legacy/lib/ezdb/classes/ezmysqlidb.php(50): eZMySQLiDB->connect('localhost', '*****', '*****', '*****', false, 'utf-8', '')

#1 [internal function]: eZMySQLiDB->eZMySQLiDB(Array)

#2 [...]/ezpublish_legacy/lib/ezutils/classes/ezextension.php(551): ReflectionClass->newInstanceArgs(Array)

#3 [...]/ezpublish_legacy/lib/ezdb/classes/ezdb.php(268): eZExtension::getHandlerClass(Object(ezpExtensionOptions))

#4 [...]/ezpublish_legacy/kernel/classes/ezpersistentobject.php(801): eZDB::instance()

#5 [...]/ez in [...]/ezpublish_legacy/lib/ezdb/classes/ezmysqlidb.php on line 135


To me, it seems that the kernel tries to access a MySQL DB, though a Postgres DB is configured (and properly used if accessed by the command line). Has anybody seen this before? I haven't found this bug reported before, so maybe it's my fault and I missed some important configuration change?

Any help is heavily appreciated!

best regards,


Friday 23 May 2014 11:55:57 pm

I have not tested it myself, but our QA team has recently run true testes with Postgres and not reported anything like this. I think you might have to have a look into what configuration you have on the legacy side, as they somehow seems to point to mysql. (yes, Symfony/Platform stack is supposed to inject this into legacy, but you never know, in the past this did not work with dsn config for instance)

Saturday 24 May 2014 11:30:43 am

Hi André,

thank you very much for your hint! In fact, I removed all DB related configuration from the legacy config files a while ago, completely relying on the injection mechanism (which used to work well). But indeed this seems to be broken in 5.3, at least as far as the DB handler/implementation is concerned: the default site.ini contains


which is obviously not overridden by Symfony Stack configuration injection. At least, I was able to fix my issue by just adding 


to my settings/override/site.ini.append.php.

Of course, this could just be a workaround - just posting this for anybody coming across this thread with the same issue.

Edit: filed a bug ticket: https://jira.ez.no/browse/EZP-22925

Modified on Monday 26 May 2014 10:28:34 am by Markus Mahner


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from