Xojo Cloud and remote database

Hello,
I try to connect a web app running in Xojo Cloud to a remote MySQL database. Remote access to the database is enabled and
when I run the web app in debug mode in my local iMac the app can connect to the remote MySQL database. When I upload the app to Xojo Cloud I get the message: „Can’t connect to MySQL server on ‘here-comes-the-server-address.com’ (4)“
Can you give me some hint what’s going wrong?

Thanks,
Christian

Did you open the port? By default, everything is locked down tight. (Edit: I mean on the cloud server, of course.)

Hello Tim,
port 3306 is open on the remote server. Or do I need to open some port in Xojo Cloud?

Do I need to ask Xojo support to open the port? I can’t see anything related to ports in the Xojo Cloud control panel.

You need to open it in Xojo Cloud. See FirewallPort in the docs. You open it in your program and it is only open while your app is running.

Hello Tim,
in the app open event I did this:

dim fwp as New XojoCloud.FirewallPort(3306, XojoCloud.FirewallPort.Direction.Outgoing) fwp.Open()

The app seems to work as expected now. Thanks!

[quote=147311:@Christian Mézes]Hello Tim,
in the app open event I did this:

dim fwp as New XojoCloud.FirewallPort(3306, XojoCloud.FirewallPort.Direction.Outgoing) fwp.Open()

The app seems to work as expected now. Thanks![/quote]
Make sure you keep a reference to fwp as long as you need that port to stay open. If you don’t, it will automatically close and your connection will be closed.

Also, please seriously consider what you’re doing. Having a MySQL database directly available on the internet is an invitation for trouble. You should really have an API of some sort which is publicly available and then have that access the database privately.

Thanks Greg,
I am keeping a reference to fp now.
The direct connection to the database is only a temporary solution.