I have written a Node.Js Application for demo purpose to connect to DB. I ma new to DO platform and connecting remote servers. The Node.Js application that I have written, I am able to connect to MySQL DB (present/using Managed DB Cluster provided by DO.) The logic is same, connection string details different. But, that same Node.Js application is unable to establish a connection to the MySQL present on the same ubuntu machine. I have taken a LEMP stack on Ubuntu. On, the LEMP stack ubuntu machine. I have PhpMyAdmin also which is working fine. In addition to LEMP, I have Node installed on the same Ubuntu Virtual Machine. This Node.Js application is unable to establish a connection to the MySQL which is a part of LEMP on this Ubuntu machine. But, the node.js application is able to establish connection to MySQL Managed DB Cluster.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.