Blank submission page in 3.1 -- Unknown MySQL server host

Hi, we’ve upgraded to 3.1.0.1 and are getting a completely white /submissions page with this error:

[Wed Jan 03 07:46:54 2018] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY000] [2005] Unknown MySQL server host ‘127.0.0.1:3307’ (2)’ in /var/www/ojs/lib/pkp/lib/vendor/illuminate/database/Illuminate/Database/Connectors/Connector.php:47\n

Stack trace:\n#0 /var/www/ojs/lib/pkp/lib/vendor/illuminate/database/Illuminate/Database/Connectors/Connector.php(47): PDO->__construct(‘mysql:host=127…’, ‘', '******’, Array)\n#1 /var/www/ojs/lib/pkp/lib/vendor/illuminate/database/Illuminate/Database/Connectors/MySqlConnector.php(20): Illuminate\Database\Connectors\Connector->createConnection(‘mysql:host=127…’, Array, Array)\n#2 /var/www/ojs/lib/pkp/lib/vendor/illuminate/database/Illuminate/Database/Connectors/ConnectionFactory.php(59): Illuminate\Database\Connectors\MySqlConnector->connect(Array)\n#3 /var/www/ojs/lib/pkp/lib/vendor/illuminate/database/Illuminate/Database/Connectors/ConnectionFactory.php(47): Illuminate\Database\Connectors\ConnectionFactory->createSingleConnection(Array)\n#4 /var/www/ojs/lib/pkp/lib/vendor/illuminat in /var/www/ojs/lib/pkp/lib/vendor/illuminate/database/Illuminate/Database/Connectors/Connector.php on line 47, referer: http://…

127.0.0.1:3307 is definitely the right database. When I type “mysql -h 127.0.0.1 --port 3307” it connects right up.

Any ideas how to fix?

Updating to add When I change the port to it’s default and then remove the :3307 from config.inc.php, it works! That’s not an ideal solution, though, because we’re using HAProxy to connect to a mysql cluster and setting the port to 3306 means that if someone ever accidentally started the local mysql server our site would break (eek!)

Hi @seamus

Have you tried use “localhost” instead “127.0.0.1” in config.inc.php ?

Regards,
Israel Cefrin
Public Knowledge Project Team

Hi @israel.cefrin

I have, but localhost:3307 gets me a big Database connection failed message on the page.

Hi @seamus

Could it be possible that your webserver user (e.g.: www-data) has not enough privileges granted to access your DB server?
Please check it.

Regards,
Israel Cefrin
Public Knowledge Project Team