Connect to External MySQL Database

Hi folks,

I developed a Web Application in local machine that connect to another server with MySQL Database, and the applications works well… But when i deployed it on XOJO Cloud i get error “Cannot to connect to MYSQL Server”. Now i have a lot of doubts.

  1. Its possible the application inside XOJO Cloud connect to server external XOJO CLoud?

  2. I tried to connect in XOJO Cloud MySQL Database enabling the MySQL on panel and use the IP as HOST, and the Username and password from panel on MySQL Workbanch, but i cant connect… Its possible to create a external connection ?

  3. I have an application in PHP that need to access the same database, is possible a third application access the Database?

  4. Its possible i create the database inside application? for example to make connection to MySQL i need this informations

Host Name or IP Address – Enter “localhost”*
Port – 5432 for PostgreSQL, 3306 for MySQL
Database – Enter the user name that was provided to you in the Xojo Cloud control panel when setting up the database server.
User Name – Enter the user name that was provided to you in the Xojo Cloud control panel when setting up the database server.
Password – Enter the password that was provided to you in the Xojo Cloud control panel when setting up the database server.

I Dont have the database name in panel, how can i find it? or i need to create via application ?

Can someone help me with it?

First of all, you should never expose a database directly to the internet. Hackers look for this when scanning machines. Use another program to act as an API so you can limit access.

The MySQL instances on the Xojo Cloud servers are specifically set up to only listen on localhost to prevent access from the outside world.

As for your app connecting to another server (and I still think this is a bad idea), you’ll have to punch a hole through the firewall using the FirewallPort class:

http://documentation.xojo.com/index.php/FirewallPort

1 Like

Hi Greg,

Thanks a lot for your answer, i solve it!