How to set database connection when host denies access from outside?

Yes, please send me your ftp details and database details as a private message, so i can check if there is anything wrong.

Won’t be in office for a couple of hours but I will simply authorise you on my control panel for a spare domain so you can see exactly what the issue is.

Sounds like a good plan Brian. I apologise its easy to take it for granted just being able to log-in and do whatever we like to our boxes as hosts. Having been in the same position with regards to relying on second or third parties I do appreciate the headaches that can be caused. It was one of the reasons we decided to do it all ourselves in the end, and have never looked back.

I live in the countryside in northern England. Simply don’t have the bandwidth to host dozens of sites locally

2am trips to Telehouse (used to co-locate a dozen boxes there for a game server provider) in London to bring online servers was never my favorite aspect of hosting. These days we rent our hardware. Nothing shared. All dedicated. I don’t miss those early mornings and calls from our server admins I can tell you!

I’ve gone off topic :slight_smile:

Am very sure Teodor will get to the bottom of any problems though!

So again to recap:

How to determine your database server name

  1. Is your database server on the same ip as your web server - use localhost
  2. Is your database server remote to your web server - use its remote address
  3. If you don’t know - ask your hosting provider what database address you should enter when accessing the database from PHP on your website. Like for PDO connection string, Wappler uses that

What makes me a bit curious: After editing the connection parameters in dmxConnect/modules/Connections/ and uploading the project to the remote target, everything works perfectly, the website connects to the database. That means, connecting within the server does work.
So how can it happen that the connection gets refused by the server when I edit the EXACT same parameters in the frontend and try to save them. If Wappler really uploaded the file before attempting to connect, it would work the same as I did it manually.

What I also tried is to change the server to localhost. Same problem. In the frontend editor and also when I edited it manually. So regarding the server, the database server only allows connections from the ftp server and nothing else which also means, no localhost possible.

@George and @Teodor I really get your idea and imho it’s a very smart and ingenious approach to overcome these server problems. Hovewer, something doesn’t seem work otherwise I could connect the same way I did manually.

Are you sure you switched to the right target before trying to edit the connection in the UI?

I love the idea! I imagine, as soon as I started my next project, it would be on one of these servers. Because I trust you guys and I can be sure everything works the way it should! :slight_smile:

1 Like

Yes absolutely. Everything else works perfectly, all files are being uploaded I even checked the database connection file online.

Update: I just tried to change the database connection and checked the file while Wappler tries to connect. Same, parameters don’t change. I’m not sure though, if the actual connection file is the one that gets changed when the connection is being tested or if a temporary file is being created for testing.

Currently it does not use the connection file that is generated after creating a connection. It uses a file called dmxDatabase.php that is uploaded to your server, it is only used to check the connection string and get metadata from the database, after it successful checked the connection string it will generate the connection file used by Server Connect.

It is possible that the call from Wappler to dmxDatabase.php is blocked by some firewall or some configuration on the server. Some firewalls see the calls to this file as an attack.

1 Like

Ah ok thank you for the information! I wasn’t sure about that.
So as @Hyperbytes already mentioned, the php script retrieves the parameters when I save my connection in Wappler and checks the database connections as well as its structure.
So I agree @patrick, the only reason this doesn’t work is some kind of firewall on the server which blocks this request. That makes completely sense now BECAUSE: A few years ago I developed a messaging app with a few friends and we used the exact same provider for the server. Problem was, we couldn’t relay the messages through the server and after talking to the tech guys, it came out that world4you.com servers block such requests. It ended with us using a different provider which was a vserver that didn’t make any problems.

Since ftp has to work on every webserver:
What if Wappler uploads a temporary connection file with the parameters via ftp to the server instead of directly sending the parameters to dmxDatabase.php? So the script uses the parameters from the temporary file for checking the connection and structure.

1 Like

Good idea - we can definitely implement something like that - improving the current workflow of implementing the database connection was already on our todo list - next to separate connections per target.

1 Like

Perfect! I’ve already read that in the other thread regarding this matter. Connections per target do make sense! Right now I only can see my table on the actual website but not in the Wappler preview.

At this point i would like to publicly and unreservedly apologise to @George and @Teodor for my stupidly and stubbornness over this issue.
I don’t know why I had problems in the past however WAPPLER WORKS EXACTLY AS THEY SAID, I WAS WRONG and I have made a complete fool of myself by arguing when i now know i was completely wrong.
Very sorry

So now on to the next point, waphosts? Would anyone really be interested in me putting together a package (scale-able cloud servers, mysql, unlimited bandwidth, 10gb mailboxes etc, own control panel) for around 30 euros per year (depending on domain costs). Can i put something in the “Hosting - General” section and see if there is any interest?

2 Likes

No problem Brian - I just thought you didn’t got your morning coffee :slight_smile:

Sure why not - you can open a new topic in there - maybe create a poll?
Eventually I would like to partner up with many hosting providers, so they can offer Wappler as website builder to their users.

I think you could find yourself a market there. I made the suggestion as it appears there may well be a demand for Wappler friendly hosting. I’m not saying Wappler is unfriendly, far from it. More Wappler specific. Or maybe in conjunction with? Could be good for everyone involved. I’d have liked to have offered services but I know I don’t have the time to dedicate towards such an endeavor. I am however quite happy to advise if the need should arise.