I'm setting up a GraphQL server however I need to connect to a remote phpMyAdmin server which my friend provided and i am getting the error:

Error: getaddrinfo ENOTFOUND
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)

here is the code i use to connect

const mysql = require('mysql');

const db = mysql.createConnection({
    host: "",
    user: "some_user",
    password: "some_password",

db.connect((err) => {
    if (err) throw err;

I've tried removing "http://", adding port, also the IP address is an IP address for his clan website. So, the only way i have access to the database is by and i dont have any access to any config files or whatsoever, it's just a remote database that he gave me.

Thanks to whoever can help!

1 Answers

Community On

just remove the phpmyadmin in the host. Try host: host: "". Phpmyadmin is a web interface, but you want to connect directly to the mysql server wich is normaly on Port 3306.