Database manager and remote connections

Actually we simplified the database view in the latest update - it always shows you the database from the currently selected target.

When you switch targets - the database scheme will reload according to the new target.
The schema does get cached and the switch can be really fast - so that is why you are thingking maybe that you are looking at the same local connection.

We just don’t display the target name any more in the database tree - but the whole database tree and connections are fully target dependent. So you will see them for you current target.

I assumed it should do this, but it doesn’t in my case. I usually create dummy tables called website-name_local and website-name_remote, so I can see at a glance which version I’m looking at. I can clearly see that the the database doesn’t update when I change target. The page in Design view reflects the correct target, but not Database Manager.

In case it’s a clue to the problem, the list of tables do look different: the local/remote lists are sorted differently.

1 Like

Fab idea! :slight_smile:

That is interesting… for me it is not fast, it is doing a complete “Query Database Schema” every single time which takes about 30 seconds, even though I have changed nothing.

I simply toggle “Target:” at the bottom of the Wappler screen and I have a 30 second wait.

This will be improved in the next update :slight_smile: so it won’t take any time to switch at all.

1 Like

Hey Guys, you can check the following articles which answers most of the questions in this topic:

Direct connection is one if those things you don’t need until you find you do. Confused?
Generally Wappler does not connect directly to your database, it connects to a script in your web server which then connects to your database. The result is that your database always sees wappler access as being from your server address.
The database table manager needs to interface with your database server directly and some database servers require different settings for a direct connection to those needed from the web server.
If my servers case, for increased security, each database can only be accessed remotely via a specific port and using different server credentials. Due to this I need to specify different details for web server access (I.e. localhost) and remote access direct from Wappler running on my pc in the office.

Thanks Hyperbytes!

It is most confusing to play around with and end up with the same error messages. Maybe someone will put together a line by line instruction for both the local and remote connections.

all kind of databases you want to use in it

We may include here the oracle database?

If it helps,this is one of my database servers set up as Server connect and Direct Database connections

image

Server Connect

Direct Connection

1 Like

Thank you so much!

For the Host address, port and other information as shown in your images, would I get this from the web host where the database resides? For instance, Bluehost?

For instance, your Direct Database Connection: Host has more details, i.e. mysql.stackcp.com. Mine only shows the Host as localhost, with no Port.

I assume that the User info, and Password info would be the same used as per the existing Server Action DB connection info.

Your info helped me so much. It caused me to do more research and this is what I found:

Configuration Settings:

Use the following configuration settings for connecting to your database

Host name = (use the server IP address)
Database name = (cpanelUsername_databaseName)
Database username = (cpanelUsername_databaseUsername)
Database password = (the password you entered for that database user)
MySQL Connection Port = 3306
TCP or UDP, either is fine.

1 Like

Allowing a Remote Server to Access Your Database

Before connecting to MySQL from another computer, the connecting computer must be enabled as an Access Host .

  1. Log into cPanel and click the Remote MySQL icon , under Databases.
  2. Type in the connecting IP address, and click the Add Host button .
  • Note: You can find and add your IP address directly from this tool. Look for Your IP is: 123.123.12.123 [Add] . Clicking the [Add] link will input your IP into the field box below.
  1. Click Add , and you should now be able to connect remotely to your database.
1 Like

Found a bug though, now when i go back into the direct database connection settings they have adopted the server connect settings!

@Teodor, need a separate bug report or will this do as everything is in here?

2 Likes

Yes, having the option of what seems to be two choices: Server Connect or Direct Connect. Which should we choose?

Being able to edit and build DBs inside Wappler is highly preferred over logging into our phpMyAdmin each time to build or make changes.

Education is what we need to be able to appreciate the awesome tool this appears to be!

I would suggest that in 95% + cases, server connect will be the the correct option, direct connection is only for servers which have additional security which stops client access outside the server network. Basically try server connect first, only use direct as a fallback in the case of failure

I have to do something similar JR, authorise my IP address but I must also use different credentials.

1 Like

Server connect connection is to connect to your database from the web server . The host name there will be mostly localhost if your database and web server run on the same server

While the direct connection will be to connect remotely directly from Wappler to your database server. The host name there will be the full remote address of your database server and you will have to allow indeed remote access - at least for the ip you are on.

1 Like

You’ve got me on the trail now. I will post my findings when I’m successful. Perhaps this will help others like myself… ‘very little experience outside the beaten path of phpMyAdmin’. Ha!

1 Like

Yes if you clearly find out how it needs to be done in cPanel (maybe @psweb can help) - I will add it to my guide above.