I have been battling this for a little over 3 hours now. Enabling everything, increasing timeout limits, allowing world access to my server, and allowing remote IP connection. Still, trying direct connection over Node.js I still get the message
“Error connecting: connect ETIMEDOUT”
I made sure my site URL in project settings tallies with the database, I used the right syntax and tried it backward, etc.
I did everything, increased timeout as George instructed. Nothing worked. I even went to my backend and did multiple tweaking. I tried to connect with my IP, Domain Name, FTP, SSH, and everything out there, and some even unconventional.
I think this is worth looking into considering that a lot of topics exist on this subject and I have seen anyone that provides an actual resolution.
Oh, also let me mention that I searched every topic extensively on the subject in the community before I submitted this post.
Node.js direct database connection does not connect to the MYSQL server on WHM CPanel.
If I’m wrong, please share your step-by-step solution to connect and I will stand corrected.
OH! and when I exported my database to my Xamp localhost, I click connect and Bang! Database Connected, Instantly. Working on my localhost.
Have you added the IP you are using to connect to the Hosts file on WHM, then make sure to apply? You will probably need to do the same for the firewall, within the CSF configuration (if you are using CSF), also check ModSecurity logs if you have access as a rule may be triggered there... Which you may have to disable for the specific host...
Trust me Dave, in 3 hours. I have almost ruined my Dedicated server. I added the IP, restarted my remote server, my SQL server, almost reset my DNS, restarted DNS, restarted HTTP server (apache), removed node.js, included node.js and… (head down - sigh)
As WHM denies remote access to port 3306 you will need to remove this in the CSF ports configuration for denied ports (remote). If you have further issues try this. Also a good idea to change the default port for MySQL. Plenty of documentation and answers on how to do that on the WHM support site.
The default configuration for CSF ports is fine for Wappler to communicate at the host level as is localhost to the hosted site, all good. But for remote connections you will need to do the above for using the Database Connector/Query Builder within Wappler…