Saturday 22 December 2018

Connect to public MySQL Database from my PC

I'm attempting to connect to a MySQL Database in JavaScript, with Node.js specifically. I have a LAMP stack installedI've made a MySQL connection in Java and can add records to the database with no problem, no errors - full connectivity however I cant in Node :(I've set /etc/mysql/mysql.conf.d/mysqld.cnf file to have bind-address commented out and also set to 0.0.0.0 yet both haven't given me a solution.I've assured that the following IPTable / UFW rules have been applied to my Ubuntu Machine: (To prevent 'spam', i've uploaded it to pastebin.com)http://bit.ly/2EKIHju my code below, I've also tried:server.listen(port, "0.0.0.0") without the second argument,scrapping normalizePort, and just using 3000Without the socketPath: '/var/run/mysqld/mysqld.sock' parameterHere's my code: bin/www.jsfollowed by app.jsHere's my code: `bin/www.js\` followed by `app.js`http://bit.ly/2EDFq4w bin/www.jshttps://hastebin.com/etewenonur.js app.jsWhen "socketPath" is not included, I get this error:There was an error{ Error: connect ECONNREFUSED xx.xx.xxx.xx:3007at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1117:14)When it's not included, I getThere was an error { Error: connect ECONNREFUSED xx.xx.xxx.xx:3007 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1117:14)If anyone can help me out, I will appreciate it a lot a lot alot since I've spent the past 7 or so hours on google, i've tried every link :(, Thanks everyone

Submitted December 22, 2018 at 05:55PM by VectroChicken

No comments:

Post a Comment