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.
Before connecting to MySQL from another computer, the connecting computer must be enabled as an Access Host .
Log into cPanel and click the Remote MySQL icon , under Databases.
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.
Click Add , and you should now be able to connect remotely to your database.
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
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.
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!
I have had to use this from time to time depending on my server setup, load balancing servers etc.
Basically in cPanel, under Databases where you find the link to phpMyAdmin, you will see Remote MySQL, Click it.
Add your current Public IP to the Host and a comment if you like, then just click Add Host.
In Wappler test your connection and it should work now without being blocked.
The pain with this is that I am personally on dynamic IPv4 addressing, so every day or 2 I had to go and change to my newest supplied IP. I have started using the Wildcard to match the CIDR notation or the range I am normally given, which is great but obviously less secure in general.
After researching the connection problem I found the following could be causing the failures:
Process of Elimination Report
Firewall - Disabled my firewall. Test: FAIL
Whitelist my local IP - After whitelisting my IP address with the Host. Test: FAIL
Search for IP address of DNS ( https://dnschecker.org/ip-location.php ). After finding the IP of my DNS, I entered it in as Host. I then tried Port 3306. Test: FAIL
You can use an FQDN with cPanel (info here). If you have an account with a dynamic DNS provider (I use noip.com), you could avoid having to update IP addresses in cPanel (at least I would have thought so). You can use this to restrict FTP access too (using cPanel's FTP enforcer).
Hello All,
I’m currently in this situation also (already own and use No-ip) - I’m all set up but…
How do I tell wappler to send commands with a hostname rather than my IP address?
I’ve set the correct primary DNS suffix for my laptop but when I try and test my database connection I get the error trying to connect via:
MyDBUserName@MyIpAddress
rather than
MyDBUserName@MyNoipDomainName.
Appreciate this isn’t specifically a Wappler issue but any help would be grateful.
Cheers Anyone that can help…
I’m using mochahost it is cPanel based hosting but I don’t see FTP Enforcer?
The FTP transfers are fine (one way communication outbound).
But Mysql communications in direct database connections aren’t being accepted because wappler is using my ip address rather than a hostname.
I can whitelist the mysql remote connection by ip address fine, but not using a hostname?
It means I have to go into cPanel and whitelist my new ip every time I reconnect to my mobile hotspot, which can be up to 10 times a day. (i’m in and out of a vehicle constantly…)
thanks
I’m afraid I’ve never really looked into this as it’s always just worked. I always mirror the local and remote setup (database names, usernames and passwords etc), so haven’t taken much notice of the way the Database Connector has changed over the years. I use WAMP locally.
I don’t use Database Manager - I manage databases with Navicat. I use an HTTP tunnel to enable the connections.