An exception occurred in the driver: SQLSTATE[HY000] [2002] php_network_getaddresses

Your software
My Mautic version is: 5 (git pulled today)
My PHP version is: 8.1.28
My Database type and version is: MySQL 5.7
Hosted on VPS Ubuntu 22

Your problem
My problem is:

Struggling to connect to an external db when going through the Web installer. I can connect to it via a shared hosted version of Mautic which was also created via web installer, but I’ve decided to change hosts to a VPS server running Ubuntu 22. I’m getting the current error;

An error occured while attempting to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for DB Host Address on Ionos failed: Name or service not known

Ports are open on this VPS as well so I think this is a config error I may of missed.

These errors are showing in the log:

Fresh install (3rd time today), currently nothing in Mautic/var/logs

Steps I have tried to fix the problem:

Installed a local db to test but that came back as unreachable when on localhost, tried and that came back as Permission denied (credentials checked out previously)

Third retry between from source and Git install with composer.

Tried some walkthroughs but most of them are from 2019/2020 and the file paths are different or files don’t exist anymore.

If there is any thing to try through CLI could you give me the full path, I’m not to familiar with the Mautic file structure.

I’ve had it working previously on a shared hosting but the composer update wiped it out completely.

Any help would be great as I’ve fallen in love with Mautic and don’t really want to leave it. It’s replaced so much