I developed a PHP application with MySQL and node.js implementation. I am trying to connect to my production DB like the following:
mysql_connect('54.212.117.38', 'root', '********');
This is the Error I get :
Could not connect: Can't connect to MySQL server on '54.212.117.38' (4)
I must mention that I can reach the PHPmyAdmin directly through the browser.
Moreover, On local host the application is connecting to MySQL with no problem. I also tried restarting the Apache server, shutting down the Node.js procedure...
BTW - My production server is running Ubuntu.
Does anyone has an idea on what's the reason that it doesn't work?
There is more than one possibility. Some advice:
root
was triggering an IDS rule...).A sidenote, the mysql extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used.
the problem is the firewall rules.
When you connect via Phpmyadmin, you are connecting through the web interface and internally Phpmyadmin is connecting to localhost.