Can't connect to MySQL server on 'database.on.other.server'

Hello everyone,

I am having a piwik running on one server and a database on demand running on an other. I have the credentials fro the admin user of the database I can actually connect to it via:
mysql -h database.on.other.server -P 5302 -u admin -p

and I have access to the mysql on that server with no issues. When I am getting to the database setup on the piwik setup though I am getting the error:

Error while trying to connect to the database server: SQLSTATE[HY000] [2003] Can’t connect to MySQL server on ‘dbod-cvmweb.cern.ch’ (13)

I am adding the database server: database.on.other.server:5302

username and password are correct.

Any idea of what I am facing here?