Connect to database from golang or php program

Hi all, I try to connect using gorm or laravel to a database I created from CyberPanel.
I would like to access my database through REST Api
I set the host, user, password, but always I got an error with port
Even if I allow the port (3306)

Did I make a mistake on the installation step where I chose remote database : no ?
Do I need to reinstall everything ?
Or do you have any idea ?
I’ve searched and read a lot of links but didn’t find something useful

It was so easy with VestaCP and CentOS 7… now I switched to Rocky Linux and CyberPanel, Cyber Panel looks great, but only I have this problem

I hope someone will be able to help me.
Thanks to all

Which hosting are you using? Some hosting provider has their own firewall system apart from the cyberpanel installed firewall. Make sure you whitelist the port there too.

Otherwise try to disable firewall and see if that works.

To disable firewall, use this command

sudo systemctl stop firewalld