Remote Database connection advice

Hi guys!

I’vejust moved to a new hosting (wpxhosting) for one of my websites and they don’t allow remote connection to the db.

Could you help me understand the process during design in wappler?

For example I know that using docker to build your app you can setup a virtual server/db on your computer.

Once you are ready to use it live would it simply be a case of replicating the schema on your online db and then changing the settings of the database connection that have been saved in the wappler project to point to the online db instead and then uploading the app?

I believe that to be the case yes. As long as the schema is all exactly the same, and you call the database connection the same (i.e. db). You should be able to just create a new target with the new db settings and it should all work.

Even if you don’t have direct access to your database, a so called SSH tunneling can be used.

This means that on the background a secure SSH connection is made to your server from which you are accessing the database as it is locally.

Wappler’s database manager fully support making database connections through SSH tunneling, so you should ask your provider about it.

Also if your database is getting bigger and mission critical, you might want to consider using separate managed database services, like Digital Ocean Managed Database or Amazon RDS

Anyway check the docs as well for the database connections:

Thanks for that - I’ll ask them. It’s only going to be a small db at first, but it’s definitely something I’ll consider if I can commercialise it down the line,

Just asked them - they dont offer that access!

So my options are

  1. Build the app on a docker instance, then replicate the schema online etc
  2. Change hosting to a provider that offers remote access

Am I limiting myself without remote access? Or am I worrying about nothing?

How do you guys normally connect to your dbs?

In the end I decided to switch hosting to 20i.com. Anyone used them before? They’ve been pretty good so far!

I use 20i, direct connections are easy.

firstly create your database as normal
So go to your control panel

select MySQL Databases
image
Create your database as normal

Now select Remote SQL Access

image

You nw need to authorise your current IP address for access

You will see this screen

Select your database from the dropdown and then click “Add host”

You will see that database listed below with the IP address you have just shown added to the list and the settings you need. I have blanked out the port number deliberately

Your server then becomes mysql.stackcp.com
your database name and password are as created
HOWEVER you must use the port shown in this screen, not the standard 3306 port

NOTE: after adding the IP address you must wait 30 minutes for the load balancers to update before you can use these settings

NOTE2: If your ip address changes you will need to add that IP address to the lost

Here is an example of the Wappler setup