I'm running a node app on ubuntu server 14.04 with nginx. I have a mysql database, which was initially running on a different server. Everything worked fine, but in an effort to tune performance I moved it onto the same server and I'm getting an error trying to connect through localhost. I'm using node-mysql with the following configuration:
host: 'localhost',
user: 'root',
password: 'xxx',
database: 'xxx'
I haven't really changed anything with mysql after the initial installation, simply created a dump file and ran it to create the database.
I get the following error whenever my app hits the database:
502 (Bad Gateway)
I've searched around but everything I find on this is PHP related.
Update: Checked the pm2 logs (using pm2 to run node) and it's giving the following error:
ECONNREFUSED 127.0.0.1:3306
Is there something I need to do to open this up?