PDOException: SQLSTATE[HY000] [2003] Can't connect to MySQL server

Permalink
The installation fails to find a database which I was able to resolve and browse remotely with the very same URL and credentials from Navicat.

PDOException: SQLSTATE[HY000] [2005] Unknown MySQL server host...

Any idea why?

MySQL 8, just for the record.