Search code examples
mysqllinuxnode.jsdebianiptables

Access remote MySQL (3306) via NodeJS returns No Route (113 MySQL)


I'm trying to access my VPS's (external) MySQL database over default protocol using NodeJS's MySQL connection. After a lot of debugging I found out, by even trying it on the virtual machine using the default mysql -h -u -p handle that I'm getting the 113 response, which would mean that I cannot access it from remote hosts (for the VPS's point of view).

Strangely enough I got it working via XAMPP a month or 2 ago and now I can't access it for some reason. I've tried the iptables (I'm not insanely adept with Linux), tried telnetting but no responses.

On my VPS, netstat -an | grep 3306 returns:

tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN

I'm at a terrible loss on what to do... Anybody else got some brilliant insights?


Solution

  • As it turns out, another firewall was actively blocking my requests as there were 2 rules. My lack of Linux knowledge kept me from seeing it. The first result in the IPTABLES is leading and that one was blocking my requests.