PHP scripts accepts DB credentials but returns error during use

Hello, hoping someone can help.

I am trying to use Aiven with a PHP script on my vps server.

I was able to input the DB credentials and the PHP app accepted and verified the credentials, but when I tried to input values, I got the following error:
Error (SET002: Unable to connect to the MySQL server with the details provided

How would that be possible, IP block? Something else?